11import java .util .Arrays ;
22
33import org .junit .jupiter .api .Disabled ;
4+ import org .junit .jupiter .api .DisplayName ;
45import org .junit .jupiter .api .Test ;
56
67import static org .assertj .core .api .Assertions .assertThat ;
78
89public class HighScoresTest {
910
1011 @ Test
12+ @ DisplayName ("List of scores" )
1113 public void shouldReturnListOfScores () {
1214 HighScores highScores = new HighScores (Arrays .asList (30 , 50 , 20 , 70 ));
1315 assertThat (highScores .scores ()).isEqualTo (Arrays .asList (30 , 50 , 20 , 70 ));
1416 }
1517
1618 @ Test
1719 @ Disabled ("Remove to run test" )
20+ @ DisplayName ("Latest score" )
1821 public void shouldReturnLatestAddedScore () {
1922 HighScores highScores = new HighScores (Arrays .asList (100 , 0 , 90 , 30 ));
2023 assertThat (highScores .latest ()).isEqualTo (30 );
2124 }
2225
2326 @ Test
2427 @ Disabled ("Remove to run test" )
28+ @ DisplayName ("Personal best" )
2529 public void shouldReturnPersonalBest () {
2630 HighScores highScores = new HighScores (Arrays .asList (40 , 100 , 70 ));
2731 assertThat (highScores .personalBest ()).isEqualTo (100 );
2832 }
2933
3034 @ Test
3135 @ Disabled ("Remove to run test" )
36+ @ DisplayName ("Personal top three from a list of scores" )
3237 public void shouldReturnPersonalTopThreeFromListOfScores () {
3338 HighScores highScores = new HighScores (Arrays .asList (10 , 30 , 90 , 30 , 100 , 20 , 10 , 0 , 30 , 40 , 40 , 70 , 70 ));
3439 assertThat (highScores .personalTopThree ()).isEqualTo (Arrays .asList (100 , 90 , 70 ));
3540 }
3641
3742 @ Test
3843 @ Disabled ("Remove to run test" )
44+ @ DisplayName ("Personal top highest to lowest" )
3945 public void shouldReturnPersonalTopThreeSortedHighestToLowest () {
4046 HighScores highScores = new HighScores (Arrays .asList (20 , 10 , 30 ));
4147 assertThat (highScores .personalTopThree ()).isEqualTo (Arrays .asList (30 , 20 , 10 ));
4248 }
4349
4450 @ Test
4551 @ Disabled ("Remove to run test" )
52+ @ DisplayName ("Personal top when there is a tie" )
4653 public void shouldReturnPersonalTopThreeWhenThereIsATie () {
4754 HighScores highScores = new HighScores (Arrays .asList (40 , 20 , 40 , 30 ));
4855 assertThat (highScores .personalTopThree ()).isEqualTo (Arrays .asList (40 , 40 , 30 ));
4956 }
5057
5158 @ Test
5259 @ Disabled ("Remove to run test" )
60+ @ DisplayName ("Personal top when there are less than 3" )
5361 public void shouldReturnPersonalTopWhenThereIsLessThanThreeScores () {
5462 HighScores highScores = new HighScores (Arrays .asList (30 , 70 ));
5563 assertThat (highScores .personalTopThree ()).isEqualTo (Arrays .asList (70 , 30 ));
5664 }
5765
5866 @ Test
5967 @ Disabled ("Remove to run test" )
68+ @ DisplayName ("Personal top when there is only one" )
6069 public void shouldReturnPersonalTopWhenThereIsOnlyOneScore () {
6170 HighScores highScores = new HighScores (Arrays .asList (40 ));
6271 assertThat (highScores .personalTopThree ()).isEqualTo (Arrays .asList (40 ));
6372 }
6473
6574 @ Test
6675 @ Disabled ("Remove to run test" )
76+ @ DisplayName ("Latest score after personal top scores" )
6777 public void callingLatestAfterPersonalTopThree () {
6878 HighScores highScores = new HighScores (Arrays .asList (70 , 50 , 20 , 30 ));
6979 highScores .personalTopThree ();
@@ -72,6 +82,7 @@ public void callingLatestAfterPersonalTopThree() {
7282
7383 @ Test
7484 @ Disabled ("Remove to run test" )
85+ @ DisplayName ("Scores after personal top scores" )
7586 public void callingScoresAfterPersonalTopThree () {
7687 HighScores highScores = new HighScores (Arrays .asList (30 , 50 , 20 , 70 ));
7788 highScores .personalTopThree ();
@@ -80,6 +91,7 @@ public void callingScoresAfterPersonalTopThree() {
8091
8192 @ Test
8293 @ Disabled ("Remove to run test" )
94+ @ DisplayName ("Latest score after personal best" )
8395 public void callingLatestAfterPersonalBest () {
8496 HighScores highScores = new HighScores (Arrays .asList (20 , 70 , 15 , 25 , 30 ));
8597 highScores .personalBest ();
@@ -88,6 +100,7 @@ public void callingLatestAfterPersonalBest() {
88100
89101 @ Test
90102 @ Disabled ("Remove to run test" )
103+ @ DisplayName ("Scores after personal best" )
91104 public void callingScoresAfterPersonalBest () {
92105 HighScores highScores = new HighScores (Arrays .asList (20 , 70 , 15 , 25 , 30 ));
93106 highScores .personalBest ();
0 commit comments