我正在升级到BizUnit 4.0并移植设置步骤DatabaseDeleteStep。显然在4.0中没有db delete步骤。所以我使用DbQueryStep和RawSqlString。问题是它失败的原因
BizUnit.TestStepExecutionException: BizUnit encountered an error executing a test step ---> System.IndexOutOfRangeException: Cannot find table 0.
这很明显因为原始sql
DELETE FROM [AnnuitiesDB].[Staging].[CommonwealthAgents]
不会返回任何表格。
在BizUnit 4.0中是否有相当于DatabaseDeleteStep的步骤?
我的代码:
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')" };
testCase.SetupSteps.Add(cleanDB);
谢谢,