-
Notifications
You must be signed in to change notification settings - Fork 0
/
domain_test.go
55 lines (42 loc) · 1.15 KB
/
domain_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
package core
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestDomainObjects(t *testing.T) {
domain := NewDomain("xs.test", nil)
Convey("Constructing a new domain object", t, func() {
Convey("Should have an app object", func() {
So(domain.GetApp(), ShouldNotBeNil)
})
})
Convey("Calling Subdomain", t, func() {
subdomain := domain.Subdomain("child")
Convey("Should use the same app", func() {
So(subdomain.GetApp(), ShouldEqual, domain.GetApp())
})
})
Convey("Calling LinkDomain", t, func() {
other := domain.LinkDomain("xs.other")
Convey("Should use the same app", func() {
So(other.GetApp(), ShouldEqual, domain.GetApp())
})
})
}
func TestDomainCallExpects(t *testing.T) {
domain := NewDomain("xs.test", nil)
Convey("Setting expected call response types", t, func() {
id := NewID()
types := []interface{}{"int"}
domain.CallExpects(id, types)
Convey("Should be retrievable", func() {
_, ok := domain.GetCallExpect(id)
So(ok, ShouldBeTrue)
})
Convey("Should be removable", func() {
domain.RemoveCallExpect(id)
_, ok := domain.GetCallExpect(id)
So(ok, ShouldBeFalse)
})
})
}