public static void Or_on_nothing_returns_initial_value() { const string alternativeValue = "alternative"; TestMonads.Nothing <string>().Or(() => alternativeValue.Just()) .Match(j => j.Should().Be(alternativeValue), Assert.Fail); }
public static void Enumerable_created_from_nothing_is_empty() => TestMonads.Nothing <int>().ToEnumerable().Should().BeEmpty();
public static void Or_on_nothing_and_nothing_alternative_returns_nothing() => TestMonads.Nothing <string>().Or(() => Nothing) .Match(Assert.Fail, Assert.Pass);
public static void Nothing_to_nullable_returns_null() => TestMonads.Nothing <int>().ToNullable().Should().Be(null);