-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeez.cpp
More file actions
44 lines (29 loc) · 1.12 KB
/
Deez.cpp
File metadata and controls
44 lines (29 loc) · 1.12 KB
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
37
38
39
40
41
42
43
44
TEST(BackEndTests, Test3A){
Airport AirA("AAA");
Airport AirB("BBB");
Airport AirC("CCC");
Flight NFAC(10,0,AirA,AirC);
vector<Flight*> allFlights = {&NFAC};
vector<Booking> bookings = flightBookingQuery(allFlights, AirA, AirC);
int temp = bookings.at(0).getFlights().at(0)->getCapacity();
temp--;
purchaseBooking(bookings.at(0));
ASSERT_EQ(bookings.at(0).getFlights().at(0)->getCapacity(),temp);
}
TEST(BackEndTests, Test3B){
Airport AirA("AAA");
Airport AirB("BBB");
Airport AirC("CCC");
Flight NFAB(10,0,AirA,AirB);
Flight NFAC(11,2,AirB,AirC);
vector<Flight*> allFlights = {&NFAC, &NFAB};
vector<Booking> bookings = flightBookingQuery(allFlights, AirA, AirC);
int flight1 = bookings.at(0).getFlights().at(0)->getCapacity();
int flight2 = bookings.at(0).getFlights().at(1)->getCapacity();
purchaseBooking(bookings.at(0));
bool temp = false;
if(bookings.at(0).getFlights().at(0)->getCapacity() == (flight1 - 1) && bookings.at(0).getFlights().at(0)->getCapacity() == (flight2 - 1)){
temp = true;
}
ASSERT_EQ(true, temp);
}