public void IsTransientException_relays_to_function(bool expected) { var fixture = new Fixture(); var exception = fixture.Create <Exception>(); var functionProvider = Mock.Of <IFunctionProvider>( x => x.Func(exception) == expected); Func <Exception, bool> func = functionProvider.Func; var sut = new DelegatingTransientFaultDetectionStrategy(func); bool actual = sut.IsTransientException(exception); actual.Should().Be(expected); }
public void modest_constructor_sets_exceptionFunc_to_true_constant_function() { var sut = new DelegatingTransientFaultDetectionStrategy <Result>(result => false); sut.IsTransientException(new Fixture().Create <Exception>()).Should().BeTrue(); }