public DefaultFlightServiceTests() { // Configure an instance of the FlightsDBContext and 'in memory' database. // NOTE : Ensure that the name passed to UseInMemoryDatabase is unique to this test class! var optionsBuilder = new DbContextOptionsBuilder <FlightsDBContext>(); optionsBuilder.UseInMemoryDatabase("DefaultFlightServiceTests"); _context = new FlightsDBContext(optionsBuilder.Options); // Call the helper class to initialise AutoMapper since it handles multithreading. AutoMapperHelper.Initialize(); }
public DefaultAvailabilityServiceTests() { // Configure an instance of the FlightsDBContext and 'in memory' database. // NOTE : Ensure that the name passed to UseInMemoryDatabase is unique to this test class! var optionsBuilder = new DbContextOptionsBuilder <FlightsDBContext>(); optionsBuilder.UseInMemoryDatabase("DefaultAvailabilityServiceTests"); _context = new FlightsDBContext(optionsBuilder.Options); // Create test data before any calls var flights = FlightEntity.GenerateTestData(); _context.Flights.AddRange(flights); var bookings = BookingEntity.GenerateTestData(); _context.Bookings.AddRange(bookings); _context.SaveChanges(); // Call the helper class to initialise AutoMapper since it handles multithreading. AutoMapperHelper.Initialize(); }
public OrdersController(FlightsDBContext context) { _context = context; }
public CustomersController(FlightsDBContext context) { _context = context; }
public QueriesService(DbContextOptionsBuilder builder) { context = new FlightsDBContext(builder.Options); }
public TicketsController(FlightsDBContext context) { _context = context; }
/// <summary> /// Constructor that allows the passing of a FlightsDBContext /// </summary> /// <param name="context">FlightsDBContext to be used in this service</param> public DefaultBookingService(FlightsDBContext context) { _context = context; }
/// <summary> /// Constructor that allows the passing of a FlightsDBContext /// </summary> /// <param name="context">FlightsDBContext to be used in this service</param> public DefaultAvailabilityService(FlightsDBContext context) { _context = context; }
public DepartureCitiesController(FlightsDBContext context) { _context = context; }
public CommandsService(DbContextOptionsBuilder builder) { context = new FlightsDBContext(builder.Options); }
public ArrivalCitiesController(FlightsDBContext context) { _context = context; }
/// <summary> /// Constructor that allows the passing of a FlightsDBContext /// </summary> /// <param name="context">FlightsDBContext to be used in this service</param> public DefaultFlightService(FlightsDBContext context) { _context = context; }