private static void AssertDidNotDoWithLeft(IEither <int, string> either) { var didWithLeft = false; either.DoWithLeft(i => didWithLeft = true); Assert.That(didWithLeft, Is.False); Assert.That(either.DoWithLeft(i => i, 1337), Is.EqualTo(1337)); }
private static void AssertDoWithLeftAction(IEither <string, int> either) { var didWithLeft = false; either.DoWithLeft(v => { didWithLeft = true; }); Assert.That(didWithLeft, Is.True); }
private static void AssertDoWithLeftFunction(IEither <string, int> either) => Assert.That(either.DoWithLeft(s => s), Is.EqualTo(value));