Commit e39fad19 authored by Volker Krause's avatar Volker Krause

Test hotel reservations and weather forecasts in different time zone

The fix for this is in kitinerary, hotel and weather elements got mixed
up due to lost timezone information.
parent 96625a5f
[
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
"airline": {
"@type": "Airline",
"iataCode": "XY"
},
"arrivalAirport": {
"@type": "Airport",
"iataCode": "TXL",
"name": "Tegel"
},
"arrivalTime": {
"@type": "QDateTime",
"@value": "1995-10-17T18:35:00+01:00",
"timezone": "Europe/Berlin"
},
"departureAirport": {
"@type": "Airport",
"iataCode": "FRA"
},
"departureDay": "1995-10-17",
"departureTime": {
"@type": "QDateTime",
"@value": "1995-10-17T17:35:00+02:00",
"timezone": "Europe/Helsinki"
},
"flightNumber": "1234"
},
"reservationNumber": "XXX006"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
"airline": {
"@type": "Airline",
"iataCode": "AY",
"name": "Finnair"
},
"arrivalAirport": {
"@type": "Airport",
"iataCode": "HEL",
"name": "Helsinki-Vantaa"
},
"arrivalTime": {
"@type": "QDateTime",
"@value": "1996-10-16T20:45:00+02:00",
"timezone": "Europe/Helsinki"
},
"departureAirport": {
"@type": "Airport",
"iataCode": "TXL",
"name": "Tegel"
},
"departureDay": "1996-10-16",
"departureTime": {
"@type": "QDateTime",
"@value": "1996-10-16T17:50:00+01:00",
"timezone": "Europe/Berlin"
},
"flightNumber": "1438"
},
"reservationNumber": "XXX007"
},
{
"@context": "http://schema.org",
"@type": "LodgingReservation",
"checkinTime": {
"@type": "QDateTime",
"@value": "1996-10-16T15:00:00+02:00",
"timezone": "Europe/Helsinki"
},
"checkoutTime": {
"@type": "QDateTime",
"@value": "1996-10-17T12:00:00+02:00",
"timezone": "Europe/Helsinki"
},
"reservationFor": {
"@type": "LodgingBusiness",
"address": {
"@type": "PostalAddress",
"addressCountry": "FI"
},
"name": "Some Hotel in Finland"
},
"reservationNumber": "YYY008"
},
{
"@context": "http://schema.org",
"@type": "FlightReservation",
"reservationFor": {
"@type": "Flight",
"airline": {
"@type": "Airline",
"iataCode": "AY",
"name": "Finnair"
},
"arrivalAirport": {
"@type": "Airport",
"iataCode": "TXL",
"name": "Tegel"
},
"arrivalTime": {
"@type": "QDateTime",
"@value": "1996-10-17T18:35:00+01:00",
"timezone": "Europe/Berlin"
},
"departureAirport": {
"@type": "Airport",
"iataCode": "HEL",
"name": "Helsinki-Vantaa"
},
"departureDay": "1996-10-17",
"departureTime": {
"@type": "QDateTime",
"@value": "1996-10-17T17:35:00+02:00",
"timezone": "Europe/Helsinki"
},
"flightNumber": "1435"
},
"reservationNumber": "XXX007"
}
]
This diff is collapsed.
......@@ -509,6 +509,8 @@ private Q_SLOTS:
resMgr.importReservation(readFile(QLatin1String(SOURCE_DIR "/data/timeline/") + baseName + QLatin1String(".json")));
TripGroupManager groupMgr;
groupMgr.setReservationManager(&resMgr);
WeatherForecastManager weatherMgr;
weatherMgr.setTestModeEnabled(true);
TimelineModel model;
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
......@@ -518,6 +520,7 @@ private Q_SLOTS:
model.setCurrentDateTime(QDateTime({1996, 10, 14}, {12, 34}));
model.setReservationManager(&resMgr);
model.setTripGroupManager(&groupMgr);
model.setWeatherForecastManager(&weatherMgr);
// check state is correct for data imported at the start
ModelVerificationPoint vp(QLatin1String(SOURCE_DIR "/data/timeline/") + baseName + QLatin1String(".model"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment