有谁知道如何(在单元测试中)检查是否发生了Bus.Defer()
?看来这还不够:
Test.Saga<TSaga>(mySaga).ExpectSend < MessageThatIsDeferred >()
结果是:
ExpectedSendInvocation< MessageThatIsDeferred > not fulfilled
打电话:
DeferMessageInvocation< MessageThatIsDeferred,System.DateTime >
发布于 2015-03-03 00:30:50
似乎您正在使用Saga,在这种情况下,您应该调用RequestTimeout
,请参阅http://docs.particular.net/nservicebus/sagas-in-nservicebus#timeouts
为了测试一个传奇超时,这里有一个例子:
Test.Saga<TimeoutSaga>()
.ExpectTimeoutToBeSetIn<MyTimeout>()
.When(saga => saga.Handle(new StartMessage()));
这有道理吗?
https://stackoverflow.com/questions/28815152
复制相似问题