11import org .junit .Ignore ;
22import org .junit .Test ;
33
4- import static org .junit .Assert .assertTrue ;
4+ import static org .junit .Assert .assertEquals ;
55
66public class RobotTest {
77
@@ -10,7 +10,7 @@ public void testRobotIsCreatedWithCorrectInitialPosition() {
1010 final GridPosition initialGridPosition = new GridPosition (0 , 0 );
1111 final Robot robot = new Robot (initialGridPosition , Orientation .NORTH );
1212
13- assertTrue (robot .getGridPosition (). equals ( initialGridPosition ) );
13+ assertEquals (robot .getGridPosition (), initialGridPosition );
1414 }
1515
1616 @ Ignore ("Remove to run test" )
@@ -19,7 +19,7 @@ public void testRobotIsCreatedWithCorrectInitialOrientation() {
1919 final Orientation initialOrientation = Orientation .NORTH ;
2020 final Robot robot = new Robot (new GridPosition (0 , 0 ), initialOrientation );
2121
22- assertTrue (robot .getOrientation (). equals ( initialOrientation ) );
22+ assertEquals (robot .getOrientation (), initialOrientation );
2323 }
2424
2525 @ Ignore ("Remove to run test" )
@@ -30,7 +30,7 @@ public void testTurningRightDoesNotChangePosition() {
3030
3131 robot .turnRight ();
3232
33- assertTrue (robot .getGridPosition (). equals ( initialGridPosition ) );
33+ assertEquals (robot .getGridPosition (), initialGridPosition );
3434 }
3535
3636 @ Ignore ("Remove to run test" )
@@ -42,7 +42,7 @@ public void testTurningRightCorrectlyChangesOrientationFromNorthToEast() {
4242
4343 final Orientation expectedOrientation = Orientation .EAST ;
4444
45- assertTrue (robot .getOrientation (). equals ( expectedOrientation ) );
45+ assertEquals (robot .getOrientation (), expectedOrientation );
4646 }
4747
4848 @ Ignore ("Remove to run test" )
@@ -54,7 +54,7 @@ public void testTurningRightCorrectlyChangesOrientationFromEastToSouth() {
5454
5555 final Orientation expectedOrientation = Orientation .SOUTH ;
5656
57- assertTrue (robot .getOrientation (). equals ( expectedOrientation ) );
57+ assertEquals (robot .getOrientation (), expectedOrientation );
5858 }
5959
6060 @ Ignore ("Remove to run test" )
@@ -66,7 +66,7 @@ public void testTurningRightCorrectlyChangesOrientationFromSouthToWest() {
6666
6767 final Orientation expectedOrientation = Orientation .WEST ;
6868
69- assertTrue (robot .getOrientation (). equals ( expectedOrientation ) );
69+ assertEquals (robot .getOrientation (), expectedOrientation );
7070 }
7171
7272 @ Ignore ("Remove to run test" )
@@ -78,7 +78,7 @@ public void testTurningRightCorrectlyChangesOrientationFromWestToNorth() {
7878
7979 final Orientation expectedOrientation = Orientation .NORTH ;
8080
81- assertTrue (robot .getOrientation (). equals ( expectedOrientation ) );
81+ assertEquals (robot .getOrientation (), expectedOrientation );
8282 }
8383
8484 @ Ignore ("Remove to run test" )
@@ -89,7 +89,7 @@ public void testTurningLeftDoesNotChangePosition() {
8989
9090 robot .turnLeft ();
9191
92- assertTrue (robot .getGridPosition (). equals ( initialGridPosition ) );
92+ assertEquals (robot .getGridPosition (), initialGridPosition );
9393 }
9494
9595 @ Ignore ("Remove to run test" )
@@ -101,7 +101,7 @@ public void testTurningLeftCorrectlyChangesOrientationFromNorthToWest() {
101101
102102 final Orientation expectedOrientation = Orientation .WEST ;
103103
104- assertTrue (robot .getOrientation (). equals ( expectedOrientation ) );
104+ assertEquals (robot .getOrientation (), expectedOrientation );
105105 }
106106
107107 @ Ignore ("Remove to run test" )
@@ -113,7 +113,7 @@ public void testTurningLeftCorrectlyChangesOrientationFromWestToSouth() {
113113
114114 final Orientation expectedOrientation = Orientation .SOUTH ;
115115
116- assertTrue (robot .getOrientation (). equals ( expectedOrientation ) );
116+ assertEquals (robot .getOrientation (), expectedOrientation );
117117 }
118118
119119 @ Ignore ("Remove to run test" )
@@ -125,7 +125,7 @@ public void testTurningLeftCorrectlyChangesOrientationFromSouthToEast() {
125125
126126 final Orientation expectedOrientation = Orientation .EAST ;
127127
128- assertTrue (robot .getOrientation (). equals ( expectedOrientation ) );
128+ assertEquals (robot .getOrientation (), expectedOrientation );
129129 }
130130
131131 @ Ignore ("Remove to run test" )
@@ -137,7 +137,7 @@ public void testTurningLeftCorrectlyChangesOrientationFromEastToNorth() {
137137
138138 final Orientation expectedOrientation = Orientation .NORTH ;
139139
140- assertTrue (robot .getOrientation (). equals ( expectedOrientation ) );
140+ assertEquals (robot .getOrientation (), expectedOrientation );
141141 }
142142
143143 @ Ignore ("Remove to run test" )
@@ -148,7 +148,7 @@ public void testAdvancingDoesNotChangeOrientation() {
148148
149149 robot .advance ();
150150
151- assertTrue (robot .getOrientation (). equals ( initialOrientation ) );
151+ assertEquals (robot .getOrientation (), initialOrientation );
152152 }
153153
154154 @ Ignore ("Remove to run test" )
@@ -160,7 +160,7 @@ public void testAdvancingWhenFacingNorthIncreasesYCoordinateByOne() {
160160
161161 final GridPosition expectedGridPosition = new GridPosition (0 , 1 );
162162
163- assertTrue (robot .getGridPosition (). equals ( expectedGridPosition ) );
163+ assertEquals (robot .getGridPosition (), expectedGridPosition );
164164 }
165165
166166 @ Ignore ("Remove to run test" )
@@ -172,7 +172,7 @@ public void testAdvancingWhenFacingSouthDecreasesYCoordinateByOne() {
172172
173173 final GridPosition expectedGridPosition = new GridPosition (0 , -1 );
174174
175- assertTrue (robot .getGridPosition (). equals ( expectedGridPosition ) );
175+ assertEquals (robot .getGridPosition (), expectedGridPosition );
176176 }
177177
178178 @ Ignore ("Remove to run test" )
@@ -184,7 +184,7 @@ public void testAdvancingWhenFacingEastIncreasesXCoordinateByOne() {
184184
185185 final GridPosition expectedGridPosition = new GridPosition (1 , 0 );
186186
187- assertTrue (robot .getGridPosition (). equals ( expectedGridPosition ) );
187+ assertEquals (robot .getGridPosition (), expectedGridPosition );
188188 }
189189
190190 @ Ignore ("Remove to run test" )
@@ -196,7 +196,7 @@ public void testAdvancingWhenFacingWestDecreasesXCoordinateByOne() {
196196
197197 final GridPosition expectedGridPosition = new GridPosition (-1 , 0 );
198198
199- assertTrue (robot .getGridPosition (). equals ( expectedGridPosition ) );
199+ assertEquals (robot .getGridPosition (), expectedGridPosition );
200200 }
201201
202202 @ Ignore ("Remove to run test" )
@@ -209,8 +209,8 @@ public void testInstructionsToMoveWestAndNorth() {
209209 final GridPosition expectedGridPosition = new GridPosition (-4 , 1 );
210210 final Orientation expectedOrientation = Orientation .WEST ;
211211
212- assertTrue (robot .getGridPosition (). equals ( expectedGridPosition ) );
213- assertTrue (robot .getOrientation (). equals ( expectedOrientation ) );
212+ assertEquals (robot .getGridPosition (), expectedGridPosition );
213+ assertEquals (robot .getOrientation (), expectedOrientation );
214214 }
215215
216216 @ Ignore ("Remove to run test" )
@@ -223,8 +223,8 @@ public void testInstructionsToMoveWestAndSouth() {
223223 final GridPosition expectedGridPosition = new GridPosition (-3 , -8 );
224224 final Orientation expectedOrientation = Orientation .SOUTH ;
225225
226- assertTrue (robot .getGridPosition (). equals ( expectedGridPosition ) );
227- assertTrue (robot .getOrientation (). equals ( expectedOrientation ) );
226+ assertEquals (robot .getGridPosition (), expectedGridPosition );
227+ assertEquals (robot .getOrientation (), expectedOrientation );
228228 }
229229
230230 @ Ignore ("Remove to run test" )
@@ -237,8 +237,8 @@ public void testInstructionsToMoveEastAndNorth() {
237237 final GridPosition expectedGridPosition = new GridPosition (11 , 5 );
238238 final Orientation expectedOrientation = Orientation .NORTH ;
239239
240- assertTrue (robot .getGridPosition (). equals ( expectedGridPosition ) );
241- assertTrue (robot .getOrientation (). equals ( expectedOrientation ) );
240+ assertEquals (robot .getGridPosition (), expectedGridPosition );
241+ assertEquals (robot .getOrientation (), expectedOrientation );
242242 }
243243
244244}
0 commit comments