public void Test03_Initialize_Database_Using_DropCreateDatabaseAlways_Without_DataSeeder() { var dbContext = new FakeDbContext(); var initialiser = new DropCreateDatabaseAlways(); initialiser.Initialize(dbContext); dbContext.ensureCreatedCalled.Should().BeTrue(); dbContext.ensureDeletedCalled.Should().BeTrue(); }
public void Test06_Initialize_Database_Using_DropCreateDatabaseAlways_With_DataSeeder_For_Existing_Database() { var dbContext = new AnotherFakeDbContext(); var dataSeederMock = new Mock <IDataSeeder>(); var initialiser = new DropCreateDatabaseAlways(dataSeederMock.Object); initialiser.Initialize(dbContext); dbContext.ensureCreatedCalled.Should().BeTrue(); dbContext.ensureDeletedCalled.Should().BeTrue(); dataSeederMock.Verify(m => m.Seed(It.IsAny <DbContext>()), Times.Never); }