|
|
@ -8,9 +8,14 @@ import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
import static org.mockito.Mockito.mock; |
|
|
|
|
|
|
|
public class AircraftTest { |
|
|
|
|
|
|
|
Aircraft testAircraft = new Aircraft("Airbus", "Neo", 1990); |
|
|
|
HashSet<Flight> flights = new HashSet<>(); |
|
|
|
Flight flight1 = mock(Flight.class); |
|
|
|
Flight flight2 = mock(Flight.class); |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testClassAircraftConstructorName() { |
|
|
|
Aircraft testAircraft = new Aircraft("Airbus", "Neo", 1990); |
|
|
|
assertThat(testAircraft.getName()) |
|
|
|
.describedAs("get the name of aircraft") |
|
|
|
.isEqualTo("Airbus"); |
|
|
@ -18,14 +23,13 @@ public class AircraftTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testClassAircraftConstructorModel() { |
|
|
|
Aircraft testAircraft = new Aircraft("Airbus", "Neo", 1990); |
|
|
|
assertThat(testAircraft.getModel()) |
|
|
|
.describedAs("get the model of aircraft") |
|
|
|
.isEqualTo("Neo"); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testClassAircraftConstructorManifacturingYear() { |
|
|
|
Aircraft testAircraft = new Aircraft("Airbus", "Neo", 1990); |
|
|
|
assertThat(testAircraft.getManYear()) |
|
|
|
.describedAs("get the manifacturing year of aircraft") |
|
|
|
.isEqualTo(1990); |
|
|
@ -33,8 +37,6 @@ public class AircraftTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void test_getFlightsEmptyList() { |
|
|
|
Aircraft testAircraft = new Aircraft("Airbus", "Neo", 1990); |
|
|
|
HashSet<Flight> flights = new HashSet<>(); |
|
|
|
assertThat(testAircraft.getFlights()) |
|
|
|
.describedAs("get the manifacturing year of aircraft") |
|
|
|
.isEqualTo(flights); |
|
|
@ -42,11 +44,6 @@ public class AircraftTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void test_getFlights_wiht_2_flights() { |
|
|
|
Aircraft testAircraft = new Aircraft("Airbus", "Neo", 1990); |
|
|
|
HashSet<Flight> flights = new HashSet<>(); |
|
|
|
Flight flight1 = mock(Flight.class); |
|
|
|
Flight flight2 = mock(Flight.class); |
|
|
|
|
|
|
|
flights.add(flight1); |
|
|
|
flights.add(flight2); |
|
|
|
|
|
|
@ -59,5 +56,4 @@ public class AircraftTest { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |