public void Select2() { var a = FSharpChoice.New2Of2 <int, string>("hello"); var b = a.Select(i => i + 2); b.Match(_ => Assert.Fail("is int"), s => Assert.AreEqual("hello", s)); }
public void New() { var a = FSharpChoice.New1Of2 <int, string>(1); var b = FSharpChoice <int, string> .NewChoice1Of2(1); Assert.AreEqual(a, b); var c = FSharpChoice.New2Of2 <int, string>("a"); var d = FSharpChoice <int, string> .NewChoice2Of2("a"); Assert.AreEqual(c, d); }