private static void AssertExists(string databaseName, string connectionString) { using (var context = ExistsContext.Create(connectionString)) { AssertExists(databaseName, context); } }
private static void AssertDoesNotExist(string connectionString) { using (var context = ExistsContext.Create(connectionString)) { Assert.False(context.Database.Exists()); Assert.False(context.Database.Exists()); } }
private static void AssertDoesNotExist(string connectionString) { using (var context = ExistsContext.Create(connectionString)) { context.Database.Initialize(force: false); Assert.True(context.InitializerCalled, "Expected initializer to be called"); Assert.False(context.Exists, "Expected context to not exist");; } }
private static void AssertDoesNotExist(string connectionString) { using (var context = ExistsContext.Create(connectionString)) { context.Database.Initialize(force: false); Assert.True(context.InitializerCalled); Assert.False(context.Exists); } }
private static void AssertExistsWithConnection(string databaseName, string connectionString, bool openConnection) { using (var connection = new SqlConnection(connectionString)) { if (openConnection) { connection.Open(); } using (var context = ExistsContext.Create(connection)) { AssertExists(databaseName, context); } connection.Close(); } }
private static void AssertDoesNotExistWithConnection(string connectionString, bool openConnection) { using (var connection = new SqlConnection(connectionString)) { if (openConnection) { connection.Open(); } using (var context = ExistsContext.Create(connection)) { Assert.False(context.Database.Exists()); Assert.False(context.Database.Exists()); } connection.Close(); } }
private static void AssertDoesNotExistWithConnection(string connectionString, bool openConnection) { using (var connection = new SqlConnection(connectionString)) { if (openConnection) { connection.Open(); } using (var context = ExistsContext.Create(connection)) { context.Database.Initialize(force: false); Assert.True(context.InitializerCalled, "Expected initializer to be called"); Assert.False(context.Exists, "Expected context to not exist"); } connection.Close(); } }