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");;
            }
        }
Exemplo n.º 4
0
        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();
            }
        }