// Runs once per all tests public DbFixture() { const string connectionString = "server=localhost;database=testwithxunit;uid=Agonire;pwd=1111"; Options = new DbContextOptionsBuilder <FilmContext>() .UseMySql(connectionString) .Options; Context = new FilmContext(Options); // Context.Database.EnsureDeleted(); Context.Database.EnsureCreated(); DbTestData.CleanDb(Context); }
public void Dispose() { using var context = new FilmContext(Options); DbTestData.CleanDb(context); }
public void Dispose() { DbTestData.CleanDb(_context); }