|
|
@ -11,9 +11,13 @@ import static org.mockito.Mockito.mock; |
|
|
|
|
|
|
|
@RunWith(MockitoJUnitRunner.class) |
|
|
|
public class AirlineTest { |
|
|
|
|
|
|
|
Airline airline = new Airline("Pegasus", "1234"); |
|
|
|
Flight flight1 = mock(Flight.class); |
|
|
|
HashSet<Flight> flights = new HashSet<>(); |
|
|
|
|
|
|
|
@Test |
|
|
|
void testConstructorSetsNameParameterCorrectly() { |
|
|
|
Airline airline = new Airline("Pegasus", "1234"); |
|
|
|
assertThat(airline.getName()) |
|
|
|
.describedAs("name of airline") |
|
|
|
.isEqualTo("Pegasus"); |
|
|
@ -21,7 +25,6 @@ public class AirlineTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
void testConstructorSetsCodeParameterCorrectly() { |
|
|
|
Airline airline = new Airline("Pegasus", "1234"); |
|
|
|
assertThat(airline.getCode()) |
|
|
|
.describedAs("code of airline") |
|
|
|
.isEqualTo("1234"); |
|
|
@ -29,8 +32,6 @@ public class AirlineTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
void getFlightsReturnsEmptyListOfFlights() { |
|
|
|
Airline airline = new Airline("Pegasus", "1234"); |
|
|
|
HashSet<Flight> flights = new HashSet<>(); |
|
|
|
assertThat(airline.getFlights()) |
|
|
|
.describedAs("flights of airline") |
|
|
|
.isEqualTo(flights); |
|
|
@ -38,9 +39,6 @@ public class AirlineTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
void addFlightAddsFlightToListOfFlights() { |
|
|
|
Airline airline = new Airline("Pegasus", "1234"); |
|
|
|
Flight flight1 = mock(Flight.class); |
|
|
|
HashSet<Flight> flights = new HashSet<>(); |
|
|
|
flights.add(flight1); |
|
|
|
|
|
|
|
airline.addFlight(flight1); |
|
|
|