forked from gedaiu/fluent-asserts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalues.d
More file actions
122 lines (97 loc) · 1.72 KB
/
values.d
File metadata and controls
122 lines (97 loc) · 1.72 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
unittest {
[1, 2, 3]
.should
.contain(4);
}
unittest {
auto a = 1;
[1, 2, 3]
.should
.contain(4);
}
unittest {
/**/
[1, 2, 3]
.should
.contain(4);
}
unittest {
/++/
[1, 2, 3]
.should
.contain(4);
}
unittest {
//some comment
[1, 2, 3]
.should
.contain(4);
}
unittest {
/*
Multi line comment
*/
`multi
line
string`
.should
.contain(`multi
line
string`);
}
unittest {
Assert.equal(5, 6);
Assert.notEqual((5+1), 5);
Assert.equal((5, (11)));
}
unittest {
5.should.equal(6);
(5+1).should.equal(5);
(5, (11)).should.equal(3);
}
unittest {
foreach(value; array) {
}
found.should.equal(1);
}
unittest {
found(4).should.equal(1);
}
unittest {
({
({ }).should.beNull;
}).should.throwException!TestException.msg;
}
unittest {
[1, 2, 3].map!"a".should.throwException!TestException.msg;
}
unittest {
Assert.equal([ new Value(1), new Value(2) ], [1, 3]);
[ new Value(1), new Value(2) ].should.equal([1, 2]);
}
unittest {
describe("when there are 2 android devices and one is not healthy", {
MockDevice device1;
MockDevice device2;
it("should throw an exception if we request 2 android devices", {
({
auto result = [ device1.idup, device2.idup ].filterBy(RunOptions("", "android", 2)).array;
}).should.throwException!DeviceException.withMessage.equal("You requested 2 `androdid` devices, but there is only 1 healthy.");
});
});
}
unittest {
auto a = 1;
iota(1).map!((a) { a.should.equal(2); return a + 1; }).array;
}
unittest {
auto a = 1;
if (a == 1) {
a.should.equal(2);
}
}
unittest {
auto a = 1;
a.shoud.equal(1);
receive(2.seconds, (int m) { m.should.equal(1); });
}