forked from bsm/openrtb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inventory_test.go
68 lines (57 loc) · 1.42 KB
/
inventory_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
60
61
62
63
64
65
66
67
68
package openrtb
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("App", func() {
var subject *App
BeforeEach(func() {
err := fixture("app", &subject)
Expect(err).NotTo(HaveOccurred())
})
It("should have accessors", func() {
Expect(subject.GetPrivacyPolicy()).To(Equal(1))
})
It("should parse correctly", func() {
Expect(subject).To(Equal(&App{
Inventory: Inventory{
ID: "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfIUDA",
Name: "Yahoo Weather",
Cat: []string{"weather", "IAB15", "IAB15-10"},
Publisher: &Publisher{
ID: "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfTUCV",
Name: "yahoo",
Domain: "www.yahoo.com",
},
},
Bundle: "628677149",
Ver: "1.0.2",
StoreURL: "https://itunes.apple.com/id628677149",
}))
})
})
var _ = Describe("Site", func() {
var subject *Site
BeforeEach(func() {
err := fixture("site", &subject)
Expect(err).NotTo(HaveOccurred())
})
It("should have accessors", func() {
Expect(subject.GetPrivacyPolicy()).To(Equal(1))
})
It("should parse correctly", func() {
Expect(subject).To(Equal(&Site{
Inventory: Inventory{
ID: "102855",
Cat: []string{"IAB3-1"},
Domain: "http://www.usabarfinder.com",
Publisher: &Publisher{
ID: "8953",
Name: "local.com",
Domain: "local.com",
},
},
Page: "http://eas.usabarfinder.com/eas?cu=13824;cre=mu;target=_blank",
}))
})
})