示例#1
0
 @Test
 public void testYoungBus_TownBus_Metro() throws Exception {
   // Given
   Passenger young = new YoungAdult();
   // When
   young.addVehicle(new Bus_Town(young));
   young.addVehicle(new Bus_Metro(young));
   double fee = young.calcFee();
   // Then
   assertEquals(1700, fee, 0);
 }
示例#2
0
  @Test
  public void testAdultBusBus_Metro() throws Exception {
    // Given
    Passenger adult = new Adult();

    // When
    adult.addVehicle(new Bus(new Point(0, 0), new Point(0, 20)));
    adult.addVehicle(new Bus_Metro(adult));
    double fee = adult.calcFee();
    // Then

    assertEquals(1900, fee, 0);
  }