public void Squash_WithValue_ReturnsValue() { IMaybe <IMaybe <int> > value = Maybe.Return <IMaybe <int> >(42.ToMaybe()); var result = value.Squash(); Assert.IsTrue(result.HasValue); Assert.AreEqual(42, result.Value); }
public void Squash_WithNoValueInnerIMaybe_ReturnsNoValue() { IMaybe <IMaybe <int> > value = Maybe.Return <IMaybe <int> >(Maybe <int> .NoValue); Assert.IsTrue(Maybe <int> .NoValue == value.Squash()); }
public void Squash_WithNoValueOuterIMaybe_ReturnsNoValue() { IMaybe <IMaybe <int> > value = Maybe <IMaybe <int> > .NoValue; Assert.IsTrue(Maybe <int> .NoValue == value.Squash()); }