コード例 #1
0
        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));
        }
コード例 #2
0
        private static void AssertDoWithLeftAction(IEither <string, int> either)
        {
            var didWithLeft = false;

            either.DoWithLeft(v => { didWithLeft = true; });
            Assert.That(didWithLeft, Is.True);
        }
コード例 #3
0
 private static void AssertDoWithLeftFunction(IEither <string, int> either)
 => Assert.That(either.DoWithLeft(s => s), Is.EqualTo(value));