Exemplo n.º 1
0
 public void ThrowException(IConnectionManager connection)
 {
     //Arrange
     //Act
     //Assert
     Assert.Throws <ETLBoxException>(
         () =>
     {
         IfExistsTask.ThrowExceptionIfNotExists(connection, "xyz.Somestrangenamehere");
     });
 }
Exemplo n.º 2
0
        public static TableDefinition GetDefinitionFromTableName(string tableName, IConnectionManager connection)
        {
            IfExistsTask.ThrowExceptionIfNotExists(connection, tableName);
            ConnectionManagerType connectionType = ConnectionManagerTypeFinder.GetType(connection);

            //return ReadTableDefinitionFromDataTable(tableName, connection);
            if (connectionType == ConnectionManagerType.SqlServer)
            {
                return(ReadTableDefinitionFromSqlServer(tableName, connection));
            }
            else if (connectionType == ConnectionManagerType.SQLLite)
            {
                return(ReadTableDefinitionFromSQLite(tableName, connection));
            }
            else
            {
                throw new ETLBoxException("Unknown connection type - please pass a valid TableDefinition!");
            }
        }