public void Select_ReturnsSelectedValueInMaybe() { AssertMaybe.Behavior("Hello, World!", x => x.Select(y => y), AssertMaybeResult.SameValue); AssertMaybe.Behavior(7, x => x.Select(y => y * 6), AssertMaybeResult.Value); }
public void Return_ReturnsValueWrapedInMaybe() { AssertMaybe.Behavior(42, x => Maybe.Return(x), AssertMaybeResult.SameValue); }
public void Select_BehavesCorrectly() { AssertMaybe.Behavior(42, x => x.Select(y => y), AssertMaybeResult.SameValue); AssertMaybe.Behavior(42, x => x.Select(y => 5), AssertMaybeResult.Value); }
public void SelectMaybe_BehavesCorrectly() { AssertMaybe.Behavior(42, x => x.SelectMaybe(Maybe.Return), AssertMaybeResult.SameValue); AssertMaybe.Behavior(42, x => x.SelectMaybe(y => Maybe.Return(5)), AssertMaybeResult.Value); }
public void Return_ReturnsValueWrapedInMaybe() { AssertMaybe.Behavior(42, (Expression <Func <int, IMaybe> >)(x => Maybe.Return(x)), AssertMaybeResult.SameValue); }