public void TestSetup() { var pilot1 = new Pilot { FirstName = "TestName1", LastName = "TestName1", BirthDate = DateTime.Parse("12.07.1998"), Experience = 1 }; var pilot2 = new Pilot { FirstName = "TestName2", LastName = "TestName2", BirthDate = DateTime.Parse("28.03.1990"), Experience = 2 }; dispatcherContext.Pilots.AddRange(pilot1, pilot2); dispatcherContext.SaveChanges(); }
public void TestSetup() { var flight1 = new Flight { Number = 1111, PointOfDeparture = "TestDeparture1", DepartureTime = new DateTime(2018, 07, 10, 18, 23, 0), Destination = "TestDestination1", DestinationTime = new DateTime(2018, 07, 11, 18, 23, 0) }; var flight2 = new Flight { Number = 2222, PointOfDeparture = "TestDeparture2", DepartureTime = new DateTime(2018, 07, 10, 18, 23, 0), Destination = "TestDestination2", DestinationTime = new DateTime(2018, 07, 11, 18, 23, 0) }; dispatcherContext.Flights.AddRange(flight1, flight2); dispatcherContext.SaveChanges(); }
private void SaveChange() { Context.SaveChanges(); }