public async Task RunAsync_EventIsNotOfGivenType_ThrowsArgumentOutOfRange() { // Arrange var sagaStepAdapter = CreateSagaStepAdapter(); var sagaEvent = new SagaEvent02(); // Assert await Assert .ThrowsAsync <ArgumentOutOfRangeException>(() => sagaStepAdapter.RunAsync(sagaEvent)) .ConfigureAwait(false); }
public void IsResponsible_EventTypeNotEqualPredicateReturnsTrue_ReturnFalse() { // Arrange var sagaStepConfiguration = new SagaStepConfiguration <SagaEvent01, SagaStep01Mock>(new SagaVersion("1.0.0"), 1, _ => true); var sagaEvent = new SagaEvent02(); // Act var result = sagaStepConfiguration.IsResponsible(sagaEvent); // Assert Assert.False(result); }
public void Create_RefsNullOneStepWithDifferentEvent_ThrowInvalidOperation() { // Arrange var func = new SagaStepResolver().Create(); var sagaEvent = new SagaEvent02(); var configurations = new List <ISagaStepConfiguration> { new SagaStepConfiguration <SagaEvent01, SagaStep01Mock>(new SagaVersion("1.0.0"), 0, _ => false) }; // Assert Assert.Throws <InvalidOperationException>(() => func(sagaEvent, null, configurations)); }