Unit testing 如何测试总线。延迟()
有人知道如何检查(在单元测试中)是否发生了Unit testing 如何测试总线。延迟(),unit-testing,nservicebus,Unit Testing,Nservicebus,有人知道如何检查(在单元测试中)是否发生了Bus.Defer()?似乎这还不够: Test.Saga<TSaga>(mySaga).ExpectSend < MessageThatIsDeferred >() Test.Saga(mySaga).ExpectSend() 结果是: ExpectedSendInvocation< MessageThatIsDeferred > not fulfilled ExpectedSendInvocation未实现
Bus.Defer()
?似乎这还不够:
Test.Saga<TSaga>(mySaga).ExpectSend < MessageThatIsDeferred >()
Test.Saga(mySaga).ExpectSend()
结果是:
ExpectedSendInvocation< MessageThatIsDeferred > not fulfilled
ExpectedSendInvocation未实现
电话:
DeferMessageInvocation< MessageThatIsDeferred,System.DateTime >
DeferMessageInvocation
您似乎在使用一个传奇,在这种情况下,您应该调用RequestTimeout
,请参阅
下面是一个测试传奇超时的示例:
Test.Saga<TimeoutSaga>()
.ExpectTimeoutToBeSetIn<MyTimeout>()
.When(saga => saga.Handle(new StartMessage()));
Test.Saga()
.ExpectTimeoutToBestin()
.When(saga=>saga.Handle(newstartMessage());
这有意义吗?是的,似乎有意义:)。谢谢