public void TestCastLeft() { { var instance = new Either <int, string>(1); var result = instance.CastLeft <int?>(); result.AssertLeft(1); } { var instance = new Either <int, string>("test"); var result = instance.CastLeft <int?>(); result.AssertRight("test"); } { Assert.Throws <InvalidCastException>(() => new Either <string, int>("test").CastLeft <decimal>()); } }