Esempio n. 1
0
 @Test(expected = NotInVehicleException.class)
 public void testRemovePassengerEmpty_except() {
   System.out.println("testRemovePassengerEmpty_except");
   Human human = new Human("test hum");
   Taxi taxi = new Taxi();
   taxi.removePassenger(human);
 }
Esempio n. 2
0
 @Test
 public void testGetMaxSeats() {
   System.out.println("testGetMaxSeats");
   Taxi policeCar = new Taxi();
   int expResult = 4;
   int result = policeCar.getSeats();
   assertEquals(expResult, result);
 }
Esempio n. 3
0
 @Test
 public void testAddExtendedPassenger_seatsCheck() {
   System.out.println("testAddExtendedPassenger_seatsCheck");
   Fireman human = new Fireman("test fire");
   Taxi taxi = new Taxi();
   taxi.addPassenger(human);
   int expResult = 1;
   int result = taxi.getUsedSeats();
   assertEquals(expResult, result);
 }
Esempio n. 4
0
 @Test
 public void testRemovePassenger_seatsCheck() {
   System.out.println("testRemovePassenger_seatsCheck");
   Human human = new Human("test hum");
   Taxi taxi = new Taxi();
   taxi.addPassenger(human);
   taxi.removePassenger(human);
   int expResult = 0;
   int result = taxi.getUsedSeats();
   assertEquals(expResult, result);
 }
Esempio n. 5
0
 @Test
 public void testAddManyNullPassengers_seatsCheck() {
   System.out.println("testAddManyNullPassengers_seatsCheck");
   Human human = null;
   Human human2 = null;
   Human human3 = null;
   Taxi taxi = new Taxi();
   taxi.addPassenger(human);
   taxi.addPassenger(human2);
   taxi.addPassenger(human3);
   int expResult = 3;
   int result = taxi.getUsedSeats();
   assertEquals(expResult, result);
 }
Esempio n. 6
0
 @Test(expected = NotEnoughSeatsException.class)
 public void testAddPassengerOverMax_except() {
   System.out.println("testAddPassengerOverMax_except");
   Human human = new Human("test hum");
   Human human2 = new Human("test hum2");
   Human human3 = new Human("test hum3");
   Human human4 = new Human("test hum4");
   Human human5 = new Human("test hum4");
   Taxi taxi = new Taxi();
   taxi.addPassenger(human);
   taxi.addPassenger(human2);
   taxi.addPassenger(human3);
   taxi.addPassenger(human4);
   taxi.addPassenger(human5);
 }
Esempio n. 7
0
 @Test
 public void testAddPassengerMax_seatsCheck() {
   System.out.println("testAddPassengerMax_seatsCheck");
   Human human = new Human("test hum");
   Human human2 = new Human("test hum2");
   Human human3 = new Human("test hum3");
   Human human4 = new Human("test hum4");
   Taxi taxi = new Taxi();
   taxi.addPassenger(human);
   taxi.addPassenger(human2);
   taxi.addPassenger(human3);
   taxi.addPassenger(human4);
   int expResult = taxi.getSeats();
   int result = taxi.getUsedSeats();
   assertEquals(expResult, result);
 }