如何测试 Bus.Defer()
How to test a Bus.Defer()
有人知道如何检查(在单元测试中)是否发生了 Bus.Defer()
吗?看来这还不够:
Test.Saga<TSaga>(mySaga).ExpectSend < MessageThatIsDeferred >()
结果是:
ExpectedSendInvocation< MessageThatIsDeferred > not fulfilled
拨打电话:
DeferMessageInvocation< MessageThatIsDeferred,System.DateTime >
您似乎正在使用 Saga,在这种情况下您应该调用 RequestTimeout
,请参阅 http://docs.particular.net/nservicebus/sagas-in-nservicebus#timeouts
这里是一个测试 saga 超时的例子:
Test.Saga<TimeoutSaga>()
.ExpectTimeoutToBeSetIn<MyTimeout>()
.When(saga => saga.Handle(new StartMessage()));
这有意义吗?
有人知道如何检查(在单元测试中)是否发生了 Bus.Defer()
吗?看来这还不够:
Test.Saga<TSaga>(mySaga).ExpectSend < MessageThatIsDeferred >()
结果是:
ExpectedSendInvocation< MessageThatIsDeferred > not fulfilled
拨打电话:
DeferMessageInvocation< MessageThatIsDeferred,System.DateTime >
您似乎正在使用 Saga,在这种情况下您应该调用 RequestTimeout
,请参阅 http://docs.particular.net/nservicebus/sagas-in-nservicebus#timeouts
这里是一个测试 saga 超时的例子:
Test.Saga<TimeoutSaga>()
.ExpectTimeoutToBeSetIn<MyTimeout>()
.When(saga => saga.Handle(new StartMessage()));
这有意义吗?