public void When_Sending_A_Command_That_Should_Retry_Failure_Async() { Catch.Exception(() => AsyncContext.Run(async() => await s_commandProcessor.SendAsync(s_myCommand))); //_should_send_the_command_to_the_command_handler Assert.True(MyFailsWithFallbackDivideByZeroHandlerAsync.ShouldReceive(s_myCommand)); //_should_retry_three_times Assert.AreEqual(3, s_retryCount); }
public async Task When_Sending_A_Command_That_Should_Retry_Failure_Async() { await Catch.ExceptionAsync(() => _commandProcessor.SendAsync(_myCommand)); //_should_send_the_command_to_the_command_handler MyFailsWithFallbackDivideByZeroHandlerAsync.ShouldReceive(_myCommand).Should().BeTrue(); //_should_retry_three_times _retryCount.Should().Be(3); }