Skip to content

Commit 26e78d8

Browse files
add displayname annotations to secret-handshake
1 parent fea5f1c commit 26e78d8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

exercises/practice/secret-handshake/src/test/java/HandshakeCalculatorTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import org.junit.jupiter.api.Disabled;
2+
import org.junit.jupiter.api.DisplayName;
23
import org.junit.jupiter.api.Test;
34

45
import static org.assertj.core.api.Assertions.assertThat;
@@ -8,70 +9,81 @@ public class HandshakeCalculatorTest {
89
private final HandshakeCalculator handshakeCalculator = new HandshakeCalculator();
910

1011
@Test
12+
@DisplayName("wink for 1")
1113
public void testThatInput1YieldsAWink() {
1214
assertThat(handshakeCalculator.calculateHandshake(1)).containsExactly(Signal.WINK);
1315
}
1416

1517
@Disabled("Remove to run test")
1618
@Test
19+
@DisplayName("double blink for 10")
1720
public void testThatInput2YieldsADoubleBlink() {
1821
assertThat(handshakeCalculator.calculateHandshake(2)).containsExactly(Signal.DOUBLE_BLINK);
1922
}
2023

2124
@Disabled("Remove to run test")
2225
@Test
26+
@DisplayName("close your eyes for 100")
2327
public void testThatInput4YieldsACloseYourEyes() {
2428
assertThat(handshakeCalculator.calculateHandshake(4)).containsExactly(Signal.CLOSE_YOUR_EYES);
2529
}
2630

2731
@Disabled("Remove to run test")
2832
@Test
33+
@DisplayName("jump for 1000")
2934
public void testThatInput8YieldsAJump() {
3035
assertThat(handshakeCalculator.calculateHandshake(8)).containsExactly(Signal.JUMP);
3136
}
3237

3338
@Disabled("Remove to run test")
3439
@Test
40+
@DisplayName("combine two actions")
3541
public void testAnInputThatYieldsTwoActions() {
3642
assertThat(handshakeCalculator.calculateHandshake(3))
3743
.containsExactly(Signal.WINK, Signal.DOUBLE_BLINK);
3844
}
3945

4046
@Disabled("Remove to run test")
4147
@Test
48+
@DisplayName("reverse two actions")
4249
public void testAnInputThatYieldsTwoReversedActions() {
4350
assertThat(handshakeCalculator.calculateHandshake(19))
4451
.containsExactly(Signal.DOUBLE_BLINK, Signal.WINK);
4552
}
4653

4754
@Disabled("Remove to run test")
4855
@Test
56+
@DisplayName("reversing one action gives the same action")
4957
public void testReversingASingleActionYieldsTheSameAction() {
5058
assertThat(handshakeCalculator.calculateHandshake(24)).containsExactly(Signal.JUMP);
5159
}
5260

5361
@Disabled("Remove to run test")
5462
@Test
63+
@DisplayName("reversing no actions still gives no actions")
5564
public void testReversingNoActionsYieldsNoActions() {
5665
assertThat(handshakeCalculator.calculateHandshake(16)).isEmpty();
5766
}
5867

5968
@Disabled("Remove to run test")
6069
@Test
70+
@DisplayName("all possible actions")
6171
public void testInputThatYieldsAllActions() {
6272
assertThat(handshakeCalculator.calculateHandshake(15))
6373
.containsExactly(Signal.WINK, Signal.DOUBLE_BLINK, Signal.CLOSE_YOUR_EYES, Signal.JUMP);
6474
}
6575

6676
@Disabled("Remove to run test")
6777
@Test
78+
@DisplayName("reverse all possible actions")
6879
public void testInputThatYieldsAllActionsReversed() {
6980
assertThat(handshakeCalculator.calculateHandshake(31))
7081
.containsExactly(Signal.JUMP, Signal.CLOSE_YOUR_EYES, Signal.DOUBLE_BLINK, Signal.WINK);
7182
}
7283

7384
@Disabled("Remove to run test")
7485
@Test
86+
@DisplayName("do nothing for zero")
7587
public void testThatInput0YieldsNoActions() {
7688
assertThat(handshakeCalculator.calculateHandshake(0)).isEmpty();
7789
}

0 commit comments

Comments
 (0)