BizUnit 4.0 Deleting rows from a table - Setup / Clean up Step

Feb 2, 2012 at 2:15 PM

I am upgrading to BizUnit 4.0 and porting the setup step DatabaseDeleteStep. Apparently in 4.0 there is no db delete step. So I used the DbQueryStep with RawSqlString. The problem is that its failing with this reason


BizUnit.TestStepExecutionException: BizUnit encountered an error executing a test step ---> System.IndexOutOfRangeException: Cannot find table 0.

which is obvious because the raw sql  DELETE FROM [AnnuitiesDB].[Staging].[CommonwealthAgents] will not return any tables.

Is there a step equivalent to DatabaseDeleteStep in BizUnit 4.0?

My Code:

var cleanDB = new DbQueryStep();

        cleanDB.ConnectionString =
            "Data Source=(local);Initial Catalog=AnnuitiesDB;Integrated Security=SSPI;";

        cleanDB.NumberOfRowsExpected = 0;
        cleanDB.SQLQuery = new SqlQuery { RawSqlQuery = "DELETE FROM [Staging].[CommonwealthAgents] where (CwAAgentId='1ead5c1ab65b677f013338baa2e6636fb1c59581' or CwAAgentId='965500bfdb81b2f4595e50cac3078871c5fc4126')" };


Feb 2, 2012 at 3:27 PM

Patch 10467 has been uploaded to fix this.  See: