コード例 #1
0
 public void CreateSchemaWithDefaultConnection()
 {
     //Arrange
     //Act
     CreateSchemaTask.Create("testschema");
     //Assert
     Assert.True(IfSchemaExistsTask.IsExisting("testschema"));
 }
コード例 #2
0
 public void CreateSchema(IConnectionManager connection)
 {
     if (connection.GetType() != typeof(MySqlConnectionManager))
     {
         //Arrange
         string schemaName = "s" + TestHashHelper.RandomString(9);
         //Act
         CreateSchemaTask.Create(connection, schemaName);
         //Assert
         Assert.True(IfSchemaExistsTask.IsExisting(connection, schemaName));
     }
 }
コード例 #3
0
 public void CreateSchemaWithSpecialChar(IConnectionManager connection)
 {
     if (connection.GetType() != typeof(MySqlConnectionManager))
     {
         string QB = connection.QB;
         string QE = connection.QE;
         //Arrange
         string schemaName = $"{QB} s#!/ {QE}";
         //Act
         CreateSchemaTask.Create(connection, schemaName);
         //Assert
         Assert.True(IfSchemaExistsTask.IsExisting(connection, schemaName));
     }
 }
コード例 #4
0
        public void Drop(IConnectionManager connection)
        {
            if (connection.GetType() != typeof(MySqlConnectionManager))
            {
                //Arrange
                CreateSchemaTask.Create(connection, "testcreateschema");
                Assert.True(IfSchemaExistsTask.IsExisting(connection, "testcreateschema"));

                //Act
                DropSchemaTask.Drop(connection, "testcreateschema");

                //Assert
                Assert.False(IfSchemaExistsTask.IsExisting(connection, "testcreateschema"));
            }
        }
コード例 #5
0
        public void IfSchemaeExists(IConnectionManager connection)
        {
            if (connection.GetType() != typeof(MySqlConnectionManager))
            {
                //Arrange
                var existsBefore = IfSchemaExistsTask.IsExisting(connection, "testschema");
                CreateSchemaTask.Create(connection, "testschema");

                //Act
                var existsAfter = IfSchemaExistsTask.IsExisting(connection, "testschema");

                //Assert
                Assert.False(existsBefore);
                Assert.True(existsAfter);
            }
        }
コード例 #6
0
        public void DropIfExists(IConnectionManager connection)
        {
            if (connection.GetType() == typeof(MySqlConnectionManager) ||
                connection.GetType() == typeof(MariaDbConnectionManager) ||
                connection.GetType() == typeof(OracleConnectionManager)
                )
            {
                return;
            }

            //Arrange
            DropSchemaTask.DropIfExists(connection, "testcreateschema2");
            CreateSchemaTask.Create(connection, "testcreateschema2");
            Assert.True(IfSchemaExistsTask.IsExisting(connection, "testcreateschema2"));

            //Act
            DropSchemaTask.DropIfExists(connection, "testcreateschema2");

            //Assert
            Assert.False(IfSchemaExistsTask.IsExisting(connection, "testcreateschema2"));
        }