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 DoesNotThrow() { try { TryUtility.Try(FakeBuilder.ActionThrows()); } catch { Assert.True(false, "Expected no exception from TryUtility, but got one"); } }
public void DoesNotThrow() { try { new Try <int>(FakeBuilder.FuncThrows <int>()); } catch { Assert.True(false, "Expected no exception from TryUtility, but got one"); } }
public void DoesNotThrow() { try { int result; TryUtility.Try(FakeBuilder.FuncThrows <int>(), out result); } catch { Assert.True(false, "Expected no exception from TryUtility, but got one"); } }
public void Returns_False_If_ExceptionIsThrown() { var success = TryUtility.Try(FakeBuilder.ActionThrows()); success.Should().Be(false); }
public void Returns_True_If_NoExceptionIsThrown() { var success = TryUtility.Try(FakeBuilder.ActionDoesNotThrow()); success.Should().Be(true); }
public void Customize(IFixture fixture) { fixture.Register(() => FakeBuilder.GetInt()); }
public void Success_Is_False_When_ExceptionIsThrown() { bool @try = new Try(FakeBuilder.ActionThrows()); @try.Should().Be(false); }
public void Success_Is_True_When_NoExceptionIsThrown() { bool success = new Try(FakeBuilder.ActionDoesNotThrow()); success.Should().Be(true); }
public void Object_Is_Default_When_ExceptionIsThrown() { int result = new Try <int>(FakeBuilder.FuncThrows <int>()); result.Should().Be(default(int)); }
public void Success_Is_False_When_ExceptionIsThrown() { bool success = new Try <int>(FakeBuilder.FuncThrows <int>()); success.Should().Be(false); }