-
Notifications
You must be signed in to change notification settings - Fork 0
/
FilterFlightTests.java
36 lines (32 loc) · 1.18 KB
/
FilterFlightTests.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.gridnine.testing;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
class FilterFlightTests {
private List<Flight> flightList = FlightBuilder.createFlights();
@DisplayName("is one flight arriving before departure?")
@Test
void filterArrivingBeforeDeparture() {
assertNotNull(flightList);
assertEquals(1,
FilterFlight.filter
(new FilterFlightArrivalBeforeDeparture(),flightList).size());
}
@DisplayName("Is one flight arriving before now ?")
@Test
void filterArrivingBeforeNow() {
assertNotNull(flightList);
assertEquals(1,
FilterFlight.filter
(new FilterFlightBeforeNow(),flightList).size());
}
@DisplayName("Do two flights have ground time more than two hours?")
@Test
void filterArrivingGroundTimeMoreTwo() {
assertNotNull(flightList);
assertEquals(2,
FilterFlight.filter
(new FilterFlightGroundTimeTwoHours(),flightList).size());
}
}