Exemplo n.º 1
0
        public void Or_Success_Is_True_When_OneTry_Is_Successful()
        {
            var  @try    = new Try(FakeBuilder.ActionThrows());
            bool success = @try.Or(FakeBuilder.ActionDoesNotThrow());

            success.Should().Be(true);
        }
Exemplo n.º 2
0
        public void Or_Success_Is_False_When_BothTries_AreNot_Successful()
        {
            var  @try    = new Try(FakeBuilder.ActionThrows());
            bool success = @try.Or(FakeBuilder.ActionThrows());

            success.Should().Be(false);
        }
Exemplo n.º 3
0
        public void And_Success_Is_False_When_OneTry_IsNot_Successful()
        {
            var  @try    = new Try(FakeBuilder.ActionDoesNotThrow());
            bool success = @try.And(FakeBuilder.ActionThrows());

            success.Should().Be(false);
        }
Exemplo n.º 4
0
        public void With_Success_Is_False_When_ExceptionIsThrown()
        {
            var  @try    = new Try();
            bool success = @try.With(FakeBuilder.ActionThrows());

            success.Should().Be(false);
        }
Exemplo n.º 5
0
 public void DoesNotThrow()
 {
     try
     {
         TryUtility.Try(FakeBuilder.ActionThrows());
     }
     catch
     {
         Assert.True(false, "Expected no exception from TryUtility, but got one");
     }
 }
Exemplo n.º 6
0
        public void Returns_False_If_ExceptionIsThrown()
        {
            var success = TryUtility.Try(FakeBuilder.ActionThrows());

            success.Should().Be(false);
        }
Exemplo n.º 7
0
        public void Success_Is_False_When_ExceptionIsThrown()
        {
            bool @try = new Try(FakeBuilder.ActionThrows());

            @try.Should().Be(false);
        }