-
Notifications
You must be signed in to change notification settings - Fork 11
/
config_test.go
79 lines (64 loc) · 1.76 KB
/
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package gunit
import (
"testing"
assertions2 "github.com/smarty/gunit/assertions"
)
func TestConfigOptions(t *testing.T) {
assert := assertions2.New(t)
assert.AssertDeepEqual(configuration{}, newConfig())
assert.AssertDeepEqual(
configuration{
LongRunningTestCases: true,
},
newConfig(Options.LongRunning()),
)
assert.AssertDeepEqual(
configuration{
SkippedTestCases: true,
},
newConfig(Options.SkipAll()),
)
assert.AssertDeepEqual(
configuration{
SequentialFixture: true,
},
newConfig(Options.SequentialFixture()),
)
assert.AssertDeepEqual(
configuration{
SequentialTestCases: true,
},
newConfig(Options.SequentialTestCases()),
)
assert.AssertDeepEqual(
configuration{
SequentialTestCases: true,
SequentialFixture: true,
},
newConfig(Options.AllSequential()),
)
assert.AssertDeepEqual(
configuration{
SequentialFixture: true,
SequentialTestCases: true,
SkippedTestCases: true,
LongRunningTestCases: true,
},
newConfig(Options.AllSequential(), Options.SkipAll(), Options.LongRunning()),
)
}
func TestConfigMethods(t *testing.T) {
assert := assertions2.New(t)
parallel := newConfig()
assert.AssertTrue(parallel.ParallelFixture())
assert.AssertTrue(parallel.ParallelTestCases())
sequentialFixture := newConfig(Options.SequentialFixture())
assert.AssertFalse(sequentialFixture.ParallelFixture())
assert.AssertTrue(sequentialFixture.ParallelTestCases())
sequentialTestCases := newConfig(Options.SequentialTestCases())
assert.AssertTrue(sequentialTestCases.ParallelFixture())
assert.AssertFalse(sequentialTestCases.ParallelTestCases())
sequential := newConfig(Options.AllSequential())
assert.AssertFalse(sequential.ParallelFixture())
assert.AssertFalse(sequential.ParallelTestCases())
}