-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinfo_test.go
59 lines (52 loc) · 1.16 KB
/
info_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
52
53
54
55
56
57
58
59
package oas
import (
"testing"
)
func TestInfo(t *testing.T) {
g := NewCaseGroup("Info")
g.It("empty", `{"title":"","version":""}`, Info{})
g.It("with contact", `{"title":"","contact":{"name":"name","url":"url","email":"email"},"version":""}`, Info{
InfoObject: InfoObject{
Contact: &Contact{
ContactObject: ContactObject{
Name: "name",
URL: "url",
Email: "email",
},
},
},
})
g.It("with licence", `{"title":"","license":{"name":"MIT"},"version":""}`, Info{
InfoObject: InfoObject{
License: &License{
LicenseObject: LicenseObject{
Name: "MIT",
},
},
},
})
g.It("with specification_extensions", `{"title":"","contact":{"x-x":"x"},"license":{"name":"","x-x":"x"},"version":"","x-x":"x"}`, Info{
InfoObject: InfoObject{
Contact: &Contact{
SpecExtensions: SpecExtensions{
Extensions: map[string]interface{}{
"x-x": "x",
},
},
},
License: &License{
SpecExtensions: SpecExtensions{
Extensions: map[string]interface{}{
"x-x": "x",
},
},
},
},
SpecExtensions: SpecExtensions{
Extensions: map[string]interface{}{
"x-x": "x",
},
},
})
g.Run(t)
}