public void Given_True_Predicate_Then_Cond_Should_Return_A_RightEither_With_The_Value_Generated() { var defaultValue = -1; Either.Cond(() => true, () => 10, () => 20).Right.GetOrElse(defaultValue).Should().Be(20); }
public void Given_False_Predicate_Then_Cond_Should_Return_A_LeftEither_With_The_Value_Generated() { var defaultValue = -1; Either.Cond(() => false, () => 10, () => 20).Left.GetOrElse(defaultValue).Should().Be(10); }
public void Given_True_Predicate_Then_Cond_Should_Return_A_RightEither() { Either.Cond(() => true, () => 10, () => 20).IsRight.Should().BeTrue(); }
public void Given_False_Predicate_Then_Cond_Should_Return_A_LeftEither() { Either.Cond(() => false, () => 10, () => 20).IsLeft.Should().BeTrue(); }