Пример #1
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);
 }
Пример #2
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);
 }
Пример #3
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);
 }
Пример #4
0
 @Test(expected = NotInVehicleException.class)
 public void testRemovePassenger_except() {
   System.out.println("testRemovePassenger_seatsCheck");
   Human human = new Human("test hum");
   Taxi taxi = new Taxi();
   taxi.addPassenger(human);
   taxi.removePassenger(human);
   taxi.removePassenger(human);
 }
Пример #5
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);
 }
Пример #6
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);
 }