public void ThrowException(IConnectionManager connection) { //Arrange //Act //Assert Assert.Throws <ETLBoxException>( () => { IfExistsTask.ThrowExceptionIfNotExists(connection, "xyz.Somestrangenamehere"); }); }
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!"); } }