Beispiel #1
0
 @Test
 public void testInvalidGreaterThan30Speed() {
   expectedException.expect(IllegalArgumentException.class);
   car.setSpeed(56);
   car.validate();
 }
Beispiel #2
0
 @Test
 public void testInvalidLeastThan5Speed() {
   expectedException.expect(IllegalArgumentException.class);
   car.setSpeed(1);
   car.validate();
 }
Beispiel #3
0
 @Test
 public void testGetSpeed() {
   car.setSpeed(10);
   int speed = car.getSpeed();
   Assert.assertTrue(speed == 10);
 }
Beispiel #4
0
 @Test
 public void testValidSpeed() {
   car.setSpeed(10);
   car.validate();
   Assert.assertTrue(true);
 }
Beispiel #5
0
 @Test
 public void testSetSpeed() {
   car.setSpeed(10);
   Assert.assertTrue(true);
 }