Ejemplo n.º 1
0
        public void CreateNewDatabase()
        {
            ;
            using var connection = new SqlConnection(GetConnectionString());
            connection.Open();
            var expression = new CreateDatabase(TestDbName);

            using var statement = new Statement(expression.ToString(), connection);
            var result = statement.Execute();

            Assert.Equal(-1, result);
            using var dropStatement = new Statement(new DropDatabase(TestDbName).ToString(), connection);
            var dropResult = dropStatement.Execute();

            Assert.Equal(-1, dropResult);
            connection.Close();
        }
Ejemplo n.º 2
0
        public void CreateDatabaseWithoutCollation()
        {
            var expression = new CreateDatabase(Database);

            Assert.Equal("CREATE DATABASE " + Database, expression.ToString());
        }
Ejemplo n.º 3
0
        public void CreateDatabaseWithCollation()
        {
            var expression = new CreateDatabase(Database, Collation);

            Assert.Equal("CREATE DATABASE " + Database + " COLLATE " + Collation, expression.ToString());
        }