-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathazure_test.go
More file actions
46 lines (43 loc) · 1012 Bytes
/
azure_test.go
File metadata and controls
46 lines (43 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package model
import (
"reflect"
"testing"
)
func Test_NewAzureRepo(t *testing.T) {
tests := []struct {
name string
packageManager string
repo string
directory string
expected *AzureRepo
}{
{
name: "valid repo",
packageManager: "npm_and_yarn",
repo: "my-org/my-project/_git/my-repo",
directory: "/",
expected: &AzureRepo{
PackageManger: "npm_and_yarn",
Org: "my-org",
Project: "my-project",
Repo: "my-repo",
Directory: "/",
},
},
{
name: "invalid repo",
packageManager: "npm_and_yarn",
repo: "my-org/my-project",
directory: "/",
expected: nil,
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
actual := NewAzureRepo(test.packageManager, test.repo, test.directory)
if !reflect.DeepEqual(actual, test.expected) {
t.Errorf("expected %v, got %v", test.expected, actual)
}
})
}
}