示例#1
0
        public EmployeeApiIntegrationTests2()
        {
            var helper = new IntegrationTestHelper(true);

            _client  = helper.Client;
            _context = helper.Context;
        }
        private void SeedData(IWebHost host)
        {
            var services       = host.Services;
            var catalogContext = services.GetRequiredService <WebApplication1.Data.dataaccess.SomeDbContext>();

            Console.WriteLine("deleting...");
            catalogContext.Database.EnsureDeleted();
            //catalogContext.Database.Migrate();
            Context = catalogContext;
            catalogContext.Database.EnsureCreated();
            TestDbData.CreateData(catalogContext);
            catalogContext.SaveChanges();
        }