是否可以在VisualStudio中的加载测试期间编写自定义事务时间。通常,要记录事务时间,您将begIntimer和endtimer方法之间的交易放在以下:
之类的情况下。TestContext.BeginTimer("TransactionName");
// Do stuff for the transaction here
TestContext.EndTimer("TransactionName");
在我的代码中,我已经有存储交易的时间。我有办法报告吗?这样的东西:
WriteTimer("TransactionName", time);
我想在Visual Studio创建的测试摘要中查看结果。
使用begintransaction和endtransaction方法代替begintimer和endtimer:
TestContext.BeginTransaction ("TransactionName");
// Do stuff for the transaction here
TestContext.EndTransaction ("TransactionName");
" TrassActionName"的结果将显示在测试摘要中。