public void ActShouldCallIfSecondWhenEitherHasASecondValue() { var called = false; var target = new Either<int, string>("1"); target.Act(_ => { }, _ => called = true); Assert.That(called); }
public void ActShouldCallIfFirstWhenEitherHasAFirstValue() { var called = false; var target = new Either<int, string>(1); target.Act(_ => called = true, _ => { }); Assert.That(called); }
public void ActOneArgumentShouldNotCallIfSecondWhenEitherHasAFirstValue() { var called = false; var target = new Either<int, string>(1); target.Act(ifSecond: _ => { called = true; }); Assert.That(!called); }
public void ActOneArgumentShouldPassThroughSecondValueToIfSecond() { const string value = "6a09e667"; var target = new Either<uint, string>(value); target.Act(ifSecond: s => Assert.That(s, Is.EqualTo(value))); }
public void ActOneArgumentShouldPassThroughFirstValueToIfFirst() { const uint value = 0x6a09e667; var target = new Either<uint, string>(value); target.Act(ifFirst: f => Assert.That(f, Is.EqualTo(value))); }