public void Given_LeftIor_Then_Map_Should_Return_A_New_LeftIor_With_Same_Value() { var value = 100; var defaultValue = -1; Ior.Left <int, int>(value).Map(i => i * 2).Left.GetOrElse(defaultValue).Should().Be(value); }
public void Given_Left_Ior_Then_ToEither_Should_Return_A_Left_Either_With_The_Value() { var value = 100; var defaultValue = -1; Ior.Left <int, int>(value).ToEither().Left.GetOrElse(defaultValue).Should().Be(value); }
public void Given_Left_Ior_Then_ToLeftOption_Should_Return_A_Some_With_The_Value() { var defaultValue = -1; var value = 100; Ior.Left <int, int>(value).ToLeftOption().GetOrElse(defaultValue).Should().Be(value); }
public void Given_LeftIor_Then_MapLeft_Should_Return_A_New_LeftIor_With_Transformed_Value() { var value = 100; var transformedValue = value * 2; var defaultValue = -1; Ior.Left <int, int>(value).MapLeft(i => i * 2).Left.GetOrElse(defaultValue).Should().Be(transformedValue); }
public void Given_Left_Ior_Then_Deconstruct_Should_Return_A_None_In_Second_Position() { var value = 100; var defaultValue = -1; var ior = Ior.Left <int, int>(value); var(_, right) = ior; right.GetOrElse(defaultValue).Should().Be(defaultValue); }
public void Given_Left_Ior_Then_Deconstruct_Should_Return_A_Some_With_Left_Value_In_First_Position() { var value = 100; var defaultValue = -1; var ior = Ior.Left <int, int>(value); var(left, _) = ior; left.GetOrElse(defaultValue).Should().Be(value); }
public void Given_LeftIor_Then_MapLeft_Should_Return_A_New_LeftIor() { Ior.Left <int, int>(100).MapLeft(i => i * 2).IsLeft.Should().BeTrue(); }
public void Given_Left_Ior_Then_ToEither_Should_Return_A_Left_Either() { Ior.Left <int, int>(100).ToEither().IsLeft.Should().BeTrue(); }
public void Given_Left_Ior_Then_ToOption_Should_Return_A_None() { Ior.Left <int, int>(100).ToOption().IsNone.Should().BeTrue(); }
public void Given_LeftIor_Then_Bimap_Should_Return_A_New_LeftIor() { Ior.Left <int, int>(100).Bimap(i => i * 2, i => i * 4).IsLeft.Should().BeTrue(); }