public void ShouldSaveNewFlightInOffLineData() { StartupAsOfflineExistingUser(TestDates.NowLess1, TestDates.NowLess2); Internet.SetConnected(true); FlightData flightData = new FlightData(); Target.SaveFlight(new FlightFactory().CreateFlight(flightData, TestDates.Now), TestDates.Now); FlightData data = OfflineDataService.LoadUserData("").Result; Assert.AreEqual(1, data.Flights.Count); }
public void ShouldSaveEditedFlightInOffLineData() { StartupAsOfflineExistingUser(TestDates.NowLess1, TestDates.NowLess2); Internet.SetConnected(true); FlightData flightData = new FlightData(); Target.SaveFlight(new FlightFactory().CreateFlight(flightData, TestDates.Now), TestDates.Now); FlightData data = OfflineDataService.LoadUserData("").Result; var flight = data.Flights.First(); flight.Reg = "ABCD"; flight.IsNew = false; Target.SaveFlight(flight, TestDates.Now); FlightData data2 = OfflineDataService.LoadUserData("").Result; Assert.AreEqual("ABCD", data2.Flights.First().Reg); }