11import org .junit .jupiter .api .Disabled ;
2+ import org .junit .jupiter .api .DisplayName ;
23import org .junit .jupiter .api .Test ;
34
45import java .util .List ;
1011public class RelationshipComputerTest {
1112
1213 @ Test
14+ @ DisplayName ("empty lists" )
1315 public void testThatTwoEmptyListsAreConsideredEqual () {
1416 Relationship relationship = new RelationshipComputer <>().computeRelationship (
1517 emptyList (),
@@ -20,6 +22,7 @@ public void testThatTwoEmptyListsAreConsideredEqual() {
2022
2123 @ Disabled ("Remove to run test" )
2224 @ Test
25+ @ DisplayName ("empty list within non empty list" )
2326 public void testEmptyListIsSublistOfNonEmptyList () {
2427 Relationship relationship = new RelationshipComputer <>().computeRelationship (
2528 emptyList (),
@@ -30,6 +33,7 @@ public void testEmptyListIsSublistOfNonEmptyList() {
3033
3134 @ Disabled ("Remove to run test" )
3235 @ Test
36+ @ DisplayName ("non empty list contains empty list" )
3337 public void testNonEmptyListIsSuperlistOfEmptyList () {
3438 Relationship relationship = new RelationshipComputer <>().computeRelationship (
3539 asList ('1' , '2' , '3' ),
@@ -40,6 +44,7 @@ public void testNonEmptyListIsSuperlistOfEmptyList() {
4044
4145 @ Disabled ("Remove to run test" )
4246 @ Test
47+ @ DisplayName ("list equals itself" )
4348 public void testListIsEqualToItself () {
4449 List <String > anyList = asList ("1" , "2" , "3" );
4550
@@ -52,6 +57,7 @@ public void testListIsEqualToItself() {
5257
5358 @ Disabled ("Remove to run test" )
5459 @ Test
60+ @ DisplayName ("different lists" )
5561 public void testDifferentListsOfTheSameLengthAreUnequal () {
5662 Relationship relationship = new RelationshipComputer <>().computeRelationship (
5763 asList (1 , 2 , 3 ),
@@ -62,6 +68,7 @@ public void testDifferentListsOfTheSameLengthAreUnequal() {
6268
6369 @ Disabled ("Remove to run test" )
6470 @ Test
71+ @ DisplayName ("false start" )
6572 public void testSublistCheckDoesNotAbortAfterFalseStart () {
6673 Relationship relationship = new RelationshipComputer <>().computeRelationship (
6774 asList ('1' , '2' , '5' ),
@@ -72,6 +79,7 @@ public void testSublistCheckDoesNotAbortAfterFalseStart() {
7279
7380 @ Disabled ("Remove to run test" )
7481 @ Test
82+ @ DisplayName ("consecutive" )
7583 public void testSublistCheckHandlesExtraneousRepeatsOfFirstEntry () {
7684 Relationship relationship = new RelationshipComputer <>().computeRelationship (
7785 asList ("1" , "1" , "2" ),
@@ -82,6 +90,7 @@ public void testSublistCheckHandlesExtraneousRepeatsOfFirstEntry() {
8290
8391 @ Disabled ("Remove to run test" )
8492 @ Test
93+ @ DisplayName ("sublist at start" )
8594 public void testSublistAtStart () {
8695 Relationship relationship = new RelationshipComputer <>().computeRelationship (
8796 asList (0 , 1 , 2 ),
@@ -92,6 +101,7 @@ public void testSublistAtStart() {
92101
93102 @ Disabled ("Remove to run test" )
94103 @ Test
104+ @ DisplayName ("sublist in middle" )
95105 public void testSublistInMiddle () {
96106 Relationship relationship = new RelationshipComputer <>().computeRelationship (
97107 asList ('2' , '3' , '4' ),
@@ -102,6 +112,7 @@ public void testSublistInMiddle() {
102112
103113 @ Disabled ("Remove to run test" )
104114 @ Test
115+ @ DisplayName ("sublist at end" )
105116 public void testSublistAtEnd () {
106117 Relationship relationship = new RelationshipComputer <>().computeRelationship (
107118 asList ("3" , "4" , "5" ),
@@ -112,6 +123,7 @@ public void testSublistAtEnd() {
112123
113124 @ Disabled ("Remove to run test" )
114125 @ Test
126+ @ DisplayName ("at start of superlist" )
115127 public void testAtStartOfSuperlist () {
116128 Relationship relationship = new RelationshipComputer <>().computeRelationship (
117129 asList (0 , 1 , 2 , 3 , 4 , 5 ),
@@ -122,6 +134,7 @@ public void testAtStartOfSuperlist() {
122134
123135 @ Disabled ("Remove to run test" )
124136 @ Test
137+ @ DisplayName ("in middle of superlist" )
125138 public void testInMiddleOfSuperlist () {
126139 Relationship relationship = new RelationshipComputer <>().computeRelationship (
127140 asList ('0' , '1' , '2' , '3' , '4' , '5' ),
@@ -132,6 +145,7 @@ public void testInMiddleOfSuperlist() {
132145
133146 @ Disabled ("Remove to run test" )
134147 @ Test
148+ @ DisplayName ("at end of superlist" )
135149 public void testAtEndOfSuperlist () {
136150 Relationship relationship = new RelationshipComputer <>().computeRelationship (
137151 asList ("0" , "1" , "2" , "3" , "4" , "5" ),
@@ -142,6 +156,7 @@ public void testAtEndOfSuperlist() {
142156
143157 @ Disabled ("Remove to run test" )
144158 @ Test
159+ @ DisplayName ("first list missing element from second list" )
145160 public void testFirstListMissingElementFromSecondList () {
146161 Relationship relationship = new RelationshipComputer <>().computeRelationship (
147162 asList (1 , 3 ),
@@ -152,6 +167,7 @@ public void testFirstListMissingElementFromSecondList() {
152167
153168 @ Disabled ("Remove to run test" )
154169 @ Test
170+ @ DisplayName ("second list missing element from first list" )
155171 public void testSecondListMissingElementFromFirstList () {
156172 Relationship relationship = new RelationshipComputer <>().computeRelationship (
157173 asList ('1' , '2' , '3' ),
@@ -162,30 +178,33 @@ public void testSecondListMissingElementFromFirstList() {
162178
163179 @ Disabled ("Remove to run test" )
164180 @ Test
165- public void testThatListOrderingIsAccountedFor () {
181+ @ DisplayName ("first list missing additional digits from second list" )
182+ public void testFirstListMissingAdditionalDigitsFromSecondList () {
166183 Relationship relationship = new RelationshipComputer <>().computeRelationship (
167- asList ("1" , "2" , "3" ),
168- asList ("3" , "2" , "1" ));
184+ asList (1 , 2 ),
185+ asList (1 , 22 ));
169186
170187 assertThat (relationship ).isEqualTo (Relationship .UNEQUAL );
171188 }
172189
173190 @ Disabled ("Remove to run test" )
174191 @ Test
175- public void testThatListsWithSameDigitsButDifferentNumbersAreUnequal () {
192+ @ DisplayName ("order matters to a list" )
193+ public void testThatListOrderingIsAccountedFor () {
176194 Relationship relationship = new RelationshipComputer <>().computeRelationship (
177- asList (1 , 0 , 1 ),
178- asList (10 , 1 ));
195+ asList ("1" , "2" , "3" ),
196+ asList ("3" , "2" , "1" ));
179197
180198 assertThat (relationship ).isEqualTo (Relationship .UNEQUAL );
181199 }
182200
183201 @ Disabled ("Remove to run test" )
184202 @ Test
185- public void testFirstListMissingAdditionalDigitsFromSecondList () {
203+ @ DisplayName ("same digits but different numbers" )
204+ public void testThatListsWithSameDigitsButDifferentNumbersAreUnequal () {
186205 Relationship relationship = new RelationshipComputer <>().computeRelationship (
187- asList (1 , 2 ),
188- asList (1 , 22 ));
206+ asList (1 , 0 , 1 ),
207+ asList (10 , 1 ));
189208
190209 assertThat (relationship ).isEqualTo (Relationship .UNEQUAL );
191210 }
0 commit comments