public void And_Success_Is_True_When_BothTries_Are_Successful() { var @try = new Try <int>(FakeBuilder.FuncDoesNotThrow <int>()); bool success = @try.And(FakeBuilder.FuncDoesNotThrow <int>()); success.Should().Be(true); }
public void Returns_True_If_NoExceptionIsThrown() { int result; var success = TryUtility.Try(FakeBuilder.FuncDoesNotThrow <int>(), out result); success.Should().Be(true); }
public void And_Success_Is_False_When_OneTry_IsNot_Successful() { var @try = new Try <int>(FakeBuilder.FuncThrows <int>()); bool success = @try.And(FakeBuilder.FuncDoesNotThrow <int>()); success.Should().Be(false); }
public void With_Success_Is_True_When_NoExceptionIsThrown() { var @try = new Try <int>(); bool success = @try.With(FakeBuilder.FuncDoesNotThrow <int>()); success.Should().Be(true); }
public void Object_Is_Value_When_NoExceptionIsThrown( [Frozen] IFixture fixture) { int result = new Try <int>(FakeBuilder.FuncDoesNotThrow <int>(fixture)); result.Should().Be(fixture.Create <int>()); }
public void Or_Success_True_When_OneTry_Is_Successful() { var @try = new Try <int>(FakeBuilder.FuncThrows <int>()); bool success = @try.Or(FakeBuilder.FuncDoesNotThrow <int>()); success.Should().Be(true); }
public void Returns_Value_If_NoExceptionIsThrown( [Frozen] IFixture fixture) { int result; TryUtility.Try(FakeBuilder.FuncDoesNotThrow <int>(fixture), out result); result.Should().Be(fixture.Create <int>()); }
public void Success_Is_True_When_NoExceptionIsThrown() { bool success = new Try <int>(FakeBuilder.FuncDoesNotThrow <int>()); success.Should().Be(true); }