Exemple #1
0
 @Test
 public void testGetSeats() {
   System.out.println("testGetSeats");
   Taxi policeCar = new Taxi();
   int expResult = 0;
   int result = policeCar.getUsedSeats();
   assertEquals(expResult, result);
 }
Exemple #2
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);
 }
Exemple #3
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);
 }
Exemple #4
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);
 }
Exemple #5
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);
 }