public void CreateWithCollation(IConnectionManager connection)
        {
            //Arrange
            string dbName    = "ETLBox_" + HashHelper.RandomString(10);
            string collation = "Latin1_General_CS_AS";

            if (connection.GetType() == typeof(PostgresConnectionManager))
            {
                collation = "en_US.utf8";
            }
            if (connection.GetType() == typeof(MySqlConnectionManager))
            {
                collation = "latin1_swedish_ci";
            }
            //Act
            CreateDatabaseTask.Create(connection, dbName, collation);

            //Assert
            var dbList = GetDatabaseListTask.List(connection);

            Assert.Contains <string>(dbName, dbList);

            //Cleanup
            DropDatabaseTask.Drop(connection, dbName);
        }
        public void TestGetDatabaseList()
        {
            List <string> allDatabases = GetDatabaseListTask.List();

            Assert.IsTrue(allDatabases.Count >= 1);
            Assert.IsTrue(allDatabases.Any(name => name == DBNameParameter));
        }
Exemple #3
0
        public void GetDatabaseList()
        {
            //Arrange

            //Act
            List <string> allDatabases = GetDatabaseListTask.List(SqlConnection);

            //Assert
            Assert.True(allDatabases.Count >= 1);
            Assert.Contains(allDatabases, name => name == DBName);
        }
        public void CreateSimple(IConnectionManager connection)
        {
            //Arrange
            string dbName       = "ETLBox_" + HashHelper.RandomString(10);
            var    dbListBefore = GetDatabaseListTask.List(connection);

            Assert.DoesNotContain <string>(dbName, dbListBefore);

            //Act
            CreateDatabaseTask.Create(connection, dbName);

            //Assert
            var dbListAfter = GetDatabaseListTask.List(connection);

            Assert.Contains <string>(dbName, dbListAfter);

            //Cleanup
            DropDatabaseTask.Drop(connection, dbName);
        }
Exemple #5
0
 public void NotSupportedWithSQLite()
 {
     Assert.Throws <ETLBoxNotSupportedException>(
         () => GetDatabaseListTask.List(SQLiteConnection)
         );
 }