File tree Expand file tree Collapse file tree
exercises/concept/interfaces/src/test/java Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44import java .util .List ;
55
6- import static org .junit .Assert .assertSame ;
7- import static org .junit .Assert .assertTrue ;
6+ import static org .assertj .core .api .Assertions .assertThat ;
87
98public class RemoteControlCarTest {
109 @ Test
@@ -15,7 +14,7 @@ public void race() {
1514 TestTrack .race ((RemoteControlCar ) productionCar );
1615 TestTrack .race ((RemoteControlCar ) experimentalCar );
1716 TestTrack .race ((RemoteControlCar ) experimentalCar );
18- assertSame ( 20 , experimentalCar .getDistanceTravelled () - productionCar .getDistanceTravelled ());
17+ assertThat ( experimentalCar .getDistanceTravelled () - productionCar .getDistanceTravelled ()). isEqualTo ( 20 );
1918 }
2019
2120 @ Ignore ("Remove to run test" )
@@ -26,12 +25,12 @@ public void rankCars() {
2625 prc1 .setNumberOfVictories (3 );
2726 prc2 .setNumberOfVictories (2 );
2827 List <ProductionRemoteControlCar > rankings = TestTrack .getRankedCars (prc1 , prc2 );
29- assertSame ( prc1 , rankings .get (1 ));
28+ assertThat ( rankings .get (1 )). isEqualTo ( prc1 );
3029 }
3130
3231 @ Ignore ("Remove to run test" )
3332 @ Test
3433 public void ensureCarsAreComparables () {
35- assertTrue (RemoteControlCar .class .isAssignableFrom (ProductionRemoteControlCar .class ) );
34+ assertThat (RemoteControlCar .class ) .isAssignableFrom (ProductionRemoteControlCar .class );
3635 }
3736}
You can’t perform that action at this time.
0 commit comments