public static ExampleUnion BuildExampleFSharpUnion() { var oneCase = ExampleUnion.One; var twoCase = ExampleUnion.NewTwo("Test"); var threeCase = ExampleUnion.NewThree(3); return(threeCase); }
public void TestExampleUnionUsage() { ExampleUnion unionValue = BuildExampleFSharpUnion(); string result = unionValue.Match( () => "TEST1", s => "TEST2 " + s, i => "TEST3 " + i); Assert.AreEqual("TEST3 3", result); }