public void Should_throw_validation_exception() { if (!MsSqlSystemDataClientConnectionBuilder.IsSql2016OrHigher()) { return; } var exception = Assert.ThrowsAsync <Exception>(async() => await Scenario.Define <Context>() .WithEndpoint <SagaEndpoint>(b => b .When(session => { var startSagaMessage = new StartSagaMessage { Property = "Test" }; return(session.SendLocal(startSagaMessage)); })) .Done(c => c.StartSagaFinderUsed) .Run()); Assert.AreEqual("The saga 'When_correlation_property_is_not_mapped+SagaEndpoint+TestSaga' defines a correlation property 'Property' which is not mapped to any message. Either map it or remove it from the saga definition.", exception.Message); }
public async Task Should_correlate_the_following_message_correctly() { if (!MsSqlSystemDataClientConnectionBuilder.IsSql2016OrHigher()) { return; } var context = await Scenario.Define <Context>() .WithEndpoint <SagaEndpoint>(b => b .When(session => { var startSagaMessage = new StartSagaMessage { Property = "Test" }; return(session.SendLocal(startSagaMessage)); })) .Done(c => c.HandledOtherMessage) .Run() .ConfigureAwait(false); Assert.True(context.StartSagaFinderUsed); }