-
Notifications
You must be signed in to change notification settings - Fork 7
/
config_test.go
51 lines (45 loc) · 813 Bytes
/
config_test.go
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
47
48
49
50
51
package devicecheck
import (
"reflect"
"testing"
)
func TestNewConfig(t *testing.T) {
t.Parallel()
cases := map[string]struct {
issuer string
keyID string
env Environment
want Config
}{
"development": {
issuer: "issuer",
keyID: "keyID",
env: Development,
want: Config{
env: Development,
issuer: "issuer",
keyID: "keyID",
},
},
"production": {
issuer: "issuer",
keyID: "keyID",
env: Production,
want: Config{
env: Production,
issuer: "issuer",
keyID: "keyID",
},
},
}
for name, c := range cases {
c := c
t.Run(name, func(t *testing.T) {
t.Parallel()
got := NewConfig(c.issuer, c.keyID, c.env)
if !reflect.DeepEqual(got, c.want) {
t.Errorf("want '%+v', got '%+v'", c.want, got)
}
})
}
}