Example #1
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);
        }
Example #2
0
        public void And_Success_Is_True_When_BothTries_Are_Successful()
        {
            var  @try    = new Try(FakeBuilder.ActionDoesNotThrow());
            bool success = @try.And(FakeBuilder.ActionDoesNotThrow());

            success.Should().Be(true);
        }
Example #3
0
        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);
        }