Browse Source

aircraft refactor

feature-pr-AircraftClass
Imron 2 years ago
parent
commit
5a87ad7cae
  1. 28
      src/test/java/hs/fulda/de/ci/exam/project/AircraftTest.java

28
src/test/java/hs/fulda/de/ci/exam/project/AircraftTest.java

@ -8,45 +8,42 @@ 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);
public void testClassAircraftConstructorName() {
assertThat(testAircraft.getName())
.describedAs("get the name of aircraft")
.isEqualTo("Airbus");
}
@Test
public void testClassAircraftConstructorModel(){
Aircraft testAircraft = new Aircraft("Airbus", "Neo", 1990);
public void testClassAircraftConstructorModel() {
assertThat(testAircraft.getModel())
.describedAs("get the model of aircraft")
.isEqualTo("Neo");
}
@Test
public void testClassAircraftConstructorManifacturingYear(){
Aircraft testAircraft = new Aircraft("Airbus", "Neo", 1990);
public void testClassAircraftConstructorManifacturingYear() {
assertThat(testAircraft.getManYear())
.describedAs("get the manifacturing year of aircraft")
.isEqualTo(1990);
}
@Test
public void test_getFlightsEmptyList(){
Aircraft testAircraft = new Aircraft("Airbus", "Neo", 1990);
HashSet<Flight> flights = new HashSet<>();
public void test_getFlightsEmptyList() {
assertThat(testAircraft.getFlights())
.describedAs("get the manifacturing year of aircraft")
.isEqualTo(flights);
}
@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);
public void test_getFlights_wiht_2_flights() {
flights.add(flight1);
flights.add(flight2);
@ -59,5 +56,4 @@ public class AircraftTest {
}
}
Loading…
Cancel
Save