我曾經有過這樣的測試,它通過就好了(佐賀是完整的,一旦所有三個消息已經被處理。如何創建單元測試NServiceBus佐賀當佐賀有一個以上的處理器
Test.Saga<TestSagaHandler>(sagaId)
.When(x =>
{
x.Handle(new TestSagaStartMessageOne
{
Id = sagaId
});
x.Handle(new TestSagaStartMessageTwo
{
Id = sagaId
});
x.Handle(new TestSagaNonStartingMessage
{
Id = sagaId
});
});
.AssertSagaCompletionIs(true);
我現在想打出來的TestSagaNonStartingMessage到自己的處理程序,並做了以下內容:
Test.Saga<TestSagaHandler>(sagaId)
.When(x =>
{
x.Handle(new TestSagaStartMessageOne
{
Id = sagaId
});
x.Handle(new TestSagaStartMessageTwo
{
Id = sagaId
});
});
Test.Saga<TestSagaHandlerSingleMessage>(sagaId)
.When(x =>
x.Handle(new TestSagaNonStartingMessage
{
Id = sagaId
})
)
.AssertSagaCompletionIs(true);
然而,處理TestSagaNonStartingMessage時 - 佐賀數據沒有從以前的處理程序持久化了
我是否存在持續性問題,還是測試構建得不好?
哦,我現在看來是多麼明顯,現在4年後=)謝謝澄清=) – 2015-11-13 14:37:30