public void CheckIfExistsDatabaseTask()
 {
     //Arrange
     //Act & Assert
     Assert.Throws <ETLBoxException>(() =>
     {
         IfDatabaseExistsTask.IsExisting("test");
     });
 }
Пример #2
0
        public void IfDatabaseExists(IConnectionManager connection)
        {
            //Arrange
            string dbName       = ("ETLBox_" + HashHelper.RandomString(10)).ToLower();
            var    existsBefore = IfDatabaseExistsTask.IsExisting(connection, dbName);

            //Act
            SqlTask.ExecuteNonQuery(connection, "Create DB", $"CREATE DATABASE {dbName}");
            var existsAfter = IfDatabaseExistsTask.IsExisting(connection, dbName);

            //Assert
            Assert.False(existsBefore);
            Assert.True(existsAfter);

            //Cleanup
            DropDatabaseTask.Drop(connection, dbName);
        }
Пример #3
0
        public void Drop(IConnectionManager connection)
        {
            //Arrange
            string dbName = "ETLBox_" + TestHashHelper.RandomString(10);

            CreateDatabaseTask.Create(connection, dbName);
            bool existsBefore = IfDatabaseExistsTask.IsExisting(connection, dbName);

            //Act
            DropDatabaseTask.Drop(connection, dbName);

            //Assert
            bool existsAfter = IfDatabaseExistsTask.IsExisting(connection, dbName);

            Assert.True(existsBefore);
            Assert.False(existsAfter);
        }
Пример #4
0
 public void NotSupportedWithSQLite()
 {
     Assert.Throws <ETLBoxNotSupportedException>(
         () => IfDatabaseExistsTask.IsExisting(Config.SQLiteConnection.ConnectionManager("ControlFlow"), "Test")
         );
 }