-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathordered_test.go
More file actions
68 lines (60 loc) · 1.26 KB
/
ordered_test.go
File metadata and controls
68 lines (60 loc) · 1.26 KB
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 test_test
import (
"testing"
. "github.com/blugnu/test"
)
func TestBeBetween(t *testing.T) {
With(t)
Run(HelperTests([]HelperScenario{
{Scenario: "in expected range",
Act: func() {
Expect(2).To(BeBetween(1).And(3))
},
},
{Scenario: "outside expected range",
Act: func() {
Expect(4).ToNot(BeBetween(1).And(3))
},
},
}...))
}
func TestBeGreaterThan(t *testing.T) {
With(t)
Run(HelperTests([]HelperScenario{
{Scenario: "expected greater than and was greater than",
Act: func() {
Expect(2).To(BeGreaterThan(1))
},
},
{Scenario: "expected greater than or equal and was equal",
Act: func() {
Expect(2).To(BeGreaterThan(2).OrEqual())
},
},
{Scenario: "expected not greater than and was equal",
Act: func() {
Expect(2).ToNot(BeGreaterThan(2))
},
},
}...))
}
func TestBeLessThan(t *testing.T) {
With(t)
Run(HelperTests([]HelperScenario{
{Scenario: "expected less than and was greater than",
Act: func() {
Expect(1).To(BeLessThan(2))
},
},
{Scenario: "expected less than or equal and was equal",
Act: func() {
Expect(2).To(BeLessThan(2).OrEqual())
},
},
{Scenario: "expected not less than and was equal",
Act: func() {
Expect(2).ToNot(BeLessThan(2))
},
},
}...))
}