Skip to content

Instantly share code, notes, and snippets.

@jrutley
Created February 6, 2013 21:13
Show Gist options
  • Save jrutley/4725910 to your computer and use it in GitHub Desktop.
Save jrutley/4725910 to your computer and use it in GitHub Desktop.
[Scenario]
public class OfferToAgentSagaTest : SagaTestFixture<OfferedCallSaga>
{
private Guid sagaId;
protected OfferToAgentSagaTest()
{
LocalUri = new Uri("loopback://localhost/offer_to_agent");
}
[Given]
public void PublishOfferToAgentMessage()
{
sagaId = Guid.NewGuid();
var agentId = Guid.NewGuid();
LocalBus.Publish(new OfferToAgentMessage(sagaId, "messageID", agentId, DateTime.Now, TimeSpan.Zero));
}
[Then]
public void TheSagaShouldBeInitialized()
{
Assert.That(Saga.CorrelationId == sagaId);
}
[Finally]
public void Teardown()
{
LocalBus.Dispose();
}
}
@rupeshtiwari
Copy link

I tried this but in my case Saga is coming null. Assert.That(Saga.CorrelationId == sagaId);

Do we need to create saga before we publish message ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment