我试图在测试执行后回滚所有数据库操作。我已将 using 块包含在测试的 Execute 方法中。但每次我的代码调用 SOOrderEntry 的 SAVE() 方法时,它都会立即添加到数据库中。我对 Acumatica 还很陌生。
{
using (TestExecution.CreateTestCaseGroup("Execute: SO301000_SOOrderEntryExt_HoldReserve (2) Test"))
{
var maint = new SO301000_SOOrderEntryExt();
maint.OpenScreen();
using (TestExecution.CreateTestStepGroup("Group1"))
{
maint.Insert();
ModifyForm(maint, "SH", "C000000000", "MAIN");
maint.Save(); // after the save it is written to the DB immediately
}
}
}
无法在 Acumatica 测试 SDK 中使用 PXTransactionScope。原因是 PXTransactionScope 是在 Acumatica xRP 框架内执行的,并且不是在构建时考虑到 Test SDK。