示例#1
0
 @Test
 public void testInvalidLeastThan5Speed() {
   expectedException.expect(IllegalArgumentException.class);
   car.setSpeed(1);
   car.validate();
 }
示例#2
0
 @Test
 public void testInvalidGreaterThan30Speed() {
   expectedException.expect(IllegalArgumentException.class);
   car.setSpeed(56);
   car.validate();
 }
示例#3
0
 @Test
 public void testValidSpeed() {
   car.setSpeed(10);
   car.validate();
   Assert.assertTrue(true);
 }