forked from jmcabo/dunit
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathfluent_assertions.d
More file actions
executable file
·46 lines (38 loc) · 934 Bytes
/
fluent_assertions.d
File metadata and controls
executable file
·46 lines (38 loc) · 934 Bytes
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
#!/usr/bin/env dub
/+ dub.sdl:
name "example"
dependency "d-unit" version=">=0.8.0"
dependency "dshould" version=">=1.3.2"
+/
// Copyright Mario Kröplin 2020.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
module fluent_assertion;
import dunit;
import dshould;
/**
* This example demonstrates the reporting of test failures
* with dshould's fluent assertions.
*/
class Test
{
mixin UnitTest;
@Test
public void shouldEqualFailure() @safe pure
{
"bar".should.equal("baz");
}
@Test
public void shouldNotEqualFailure() @safe pure
{
"foo".should.not.equal("foo");
}
@Test
public void shouldBeInFailure() @safe pure
{
[0, 1, 2].should.contain(42);
}
}
// either use the 'Main' mixin or call 'dunit_main(args)'
mixin Main;