public async Task An_initiating_message_should_start_the_saga() { Guid sagaId = NewId.NextGuid(); var message = new InitiateSimpleSaga(sagaId); await InputQueueSendEndpoint.Send(message); Guid?foundId = await _sagaRepository.ShouldContainSaga(message.CorrelationId, TestTimeout); foundId.HasValue.ShouldBe(true); }
public async Task A_correlated_message_should_find_the_correct_saga() { Guid sagaId = NewId.NextGuid(); var message = new InitiateSimpleSaga(sagaId); await InputQueueSendEndpoint.Send(message); Guid?foundId = await _sagaRepository.ShouldContainSaga(message.CorrelationId, TestTimeout); foundId.HasValue.ShouldBe(true); var nextMessage = new CompleteSimpleSaga { CorrelationId = sagaId }; await InputQueueSendEndpoint.Send(nextMessage); foundId = await _sagaRepository.ShouldContainSaga(x => x.CorrelationId == sagaId && x.Completed, TestTimeout); foundId.HasValue.ShouldBe(true); }