private static void AssertDidNotDoWithRight(IEither <string, int> either) { var didWithRight = false; either.DoWithRight(i => didWithRight = true); Assert.That(didWithRight, Is.False); Assert.That(either.DoWithRight(i => i, 1337), Is.EqualTo(1337)); }
private static void AssertDoWithRightAction(IEither <int, string> either) { var didWithRight = false; either.DoWithRight(v => { didWithRight = true; }); Assert.That(didWithRight, Is.True); }
private static void AssertDoWithRightFunction(IEither <int, string> either) => Assert.That(either.DoWithRight(s => s), Is.EqualTo(value));