1
1
import org .junit .jupiter .api .Disabled ;
2
+ import org .junit .jupiter .api .DisplayName ;
2
3
import org .junit .jupiter .api .Test ;
3
4
4
5
import static org .assertj .core .api .Assertions .assertThat ;
@@ -8,70 +9,81 @@ public class HandshakeCalculatorTest {
8
9
private final HandshakeCalculator handshakeCalculator = new HandshakeCalculator ();
9
10
10
11
@ Test
12
+ @ DisplayName ("wink for 1" )
11
13
public void testThatInput1YieldsAWink () {
12
14
assertThat (handshakeCalculator .calculateHandshake (1 )).containsExactly (Signal .WINK );
13
15
}
14
16
15
17
@ Disabled ("Remove to run test" )
16
18
@ Test
19
+ @ DisplayName ("double blink for 10" )
17
20
public void testThatInput2YieldsADoubleBlink () {
18
21
assertThat (handshakeCalculator .calculateHandshake (2 )).containsExactly (Signal .DOUBLE_BLINK );
19
22
}
20
23
21
24
@ Disabled ("Remove to run test" )
22
25
@ Test
26
+ @ DisplayName ("close your eyes for 100" )
23
27
public void testThatInput4YieldsACloseYourEyes () {
24
28
assertThat (handshakeCalculator .calculateHandshake (4 )).containsExactly (Signal .CLOSE_YOUR_EYES );
25
29
}
26
30
27
31
@ Disabled ("Remove to run test" )
28
32
@ Test
33
+ @ DisplayName ("jump for 1000" )
29
34
public void testThatInput8YieldsAJump () {
30
35
assertThat (handshakeCalculator .calculateHandshake (8 )).containsExactly (Signal .JUMP );
31
36
}
32
37
33
38
@ Disabled ("Remove to run test" )
34
39
@ Test
40
+ @ DisplayName ("combine two actions" )
35
41
public void testAnInputThatYieldsTwoActions () {
36
42
assertThat (handshakeCalculator .calculateHandshake (3 ))
37
43
.containsExactly (Signal .WINK , Signal .DOUBLE_BLINK );
38
44
}
39
45
40
46
@ Disabled ("Remove to run test" )
41
47
@ Test
48
+ @ DisplayName ("reverse two actions" )
42
49
public void testAnInputThatYieldsTwoReversedActions () {
43
50
assertThat (handshakeCalculator .calculateHandshake (19 ))
44
51
.containsExactly (Signal .DOUBLE_BLINK , Signal .WINK );
45
52
}
46
53
47
54
@ Disabled ("Remove to run test" )
48
55
@ Test
56
+ @ DisplayName ("reversing one action gives the same action" )
49
57
public void testReversingASingleActionYieldsTheSameAction () {
50
58
assertThat (handshakeCalculator .calculateHandshake (24 )).containsExactly (Signal .JUMP );
51
59
}
52
60
53
61
@ Disabled ("Remove to run test" )
54
62
@ Test
63
+ @ DisplayName ("reversing no actions still gives no actions" )
55
64
public void testReversingNoActionsYieldsNoActions () {
56
65
assertThat (handshakeCalculator .calculateHandshake (16 )).isEmpty ();
57
66
}
58
67
59
68
@ Disabled ("Remove to run test" )
60
69
@ Test
70
+ @ DisplayName ("all possible actions" )
61
71
public void testInputThatYieldsAllActions () {
62
72
assertThat (handshakeCalculator .calculateHandshake (15 ))
63
73
.containsExactly (Signal .WINK , Signal .DOUBLE_BLINK , Signal .CLOSE_YOUR_EYES , Signal .JUMP );
64
74
}
65
75
66
76
@ Disabled ("Remove to run test" )
67
77
@ Test
78
+ @ DisplayName ("reverse all possible actions" )
68
79
public void testInputThatYieldsAllActionsReversed () {
69
80
assertThat (handshakeCalculator .calculateHandshake (31 ))
70
81
.containsExactly (Signal .JUMP , Signal .CLOSE_YOUR_EYES , Signal .DOUBLE_BLINK , Signal .WINK );
71
82
}
72
83
73
84
@ Disabled ("Remove to run test" )
74
85
@ Test
86
+ @ DisplayName ("do nothing for zero" )
75
87
public void testThatInput0YieldsNoActions () {
76
88
assertThat (handshakeCalculator .calculateHandshake (0 )).isEmpty ();
77
89
}
0 commit comments