DatabaseExists_returns_false_for_non_existing_database_when_using_static_method_taking_existing_connection_which_is_closed() { using (var connection = SimpleConnection <EmptyContext>()) { Assert.True(connection.State == ConnectionState.Closed); var eventsTracker = new ConnectionEventsTracker(connection); DatabaseExists_returns_false_for_non_existing_database(() => Database.Exists(connection)); eventsTracker.VerifyNoConnectionEventsWereFired(); } }
public void DatabaseExists_returns_true_for_existing_database_when_using_static_method_taking_existing_connection_which_is_opened() { using (var connection = SimpleConnection <SimpleModelContext>()) { connection.Open(); Assert.True(connection.State == ConnectionState.Open); var eventsTracker = new ConnectionEventsTracker(connection); Assert.True(Database.Exists(connection)); eventsTracker.VerifyNoConnectionEventsWereFired(); } }
DeleteDatabaseIfExists_does_nothing_if_database_does_not_exist_using_static_method_taking_existing_connection_which_is_closed() { using (var connection = SimpleConnection <EmptyContext>()) { // Arrange Assert.True(connection.State == ConnectionState.Closed); var eventsTracker = new ConnectionEventsTracker(connection); // Act DeleteDatabaseIfExists_does_nothing_if_database_does_not_exist(() => Database.Delete(connection)); // Assert eventsTracker.VerifyNoConnectionEventsWereFired(); } }