Example #1
0
        public void TestCleanup()
        {
            AirTicketEfDbContext dbContext = kernel.Get <AirTicketEfDbContext>();

            dbContext.Airlines.Attach(dbAirline);
            dbContext.Airlines.Remove(dbAirline);

            dbContext.SaveChanges();
        }
Example #2
0
        public void TestInit()
        {
            kernel = NinjectWebCommon.CreateKernel();
            AirTicketEfDbContext dbContext = kernel.Get <AirTicketEfDbContext>();

            dbContext.Airlines.Add(dbAirline);
            dbContext.SaveChanges();

            dbContext.Airports.Add(dbAirport);
            dbContext.SaveChanges();

            //var airline = dbContext.Airlines.FirstOrDefault();
            //dbFlight.AirlineId = airline.Id;
            //dbFlight.Airline = airline;

            dbContext.Flights.Add(dbFlight);
            dbContext.SaveChanges();
        }