【发布时间】:2015-01-22 20:53:03
【问题描述】:
我正在使用 the Unit testing Nuget package 对 WF4 服务进行单元测试。有一个功能可以断言测试结束跟踪信息中存在或不存在东西。
考虑以下单元测试代码:
WorkflowServiceTestHost host = null;
using (host = CreateHost())
{
var proxy = new ServiceClient(Binding, ServiceAddress);
// Call receive points in the workflow
}
finally
{
host.Tracking.Trace();
// I would like to assert stuff like the WF did not abort
// For now, I would just like to assert that there are a
// certain number of invocations of a specific activity.
// I can find no examples of how to call this:
host.Tracking.Assert.ExistsCount(?????what goes here???);
}
如何拨打ExistsCount()?原型如下所示:
public void ExistsCount<TRecord>(Predicate<TRecord> predicate, int count, string message = null) where TRecord : TrackingRecord
但我找不到任何示例或文档来了解 predicate 的预期内容。
【问题讨论】:
标签: unit-testing workflow-foundation-4 workflowservice