예제 #1
0
 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);
 }
예제 #2
0
 public void Return_ReturnsValueWrapedInMaybe()
 {
     AssertMaybe.Behavior(42, x => Maybe.Return(x), AssertMaybeResult.SameValue);
 }
예제 #3
0
 public void Select_BehavesCorrectly()
 {
     AssertMaybe.Behavior(42, x => x.Select(y => y), AssertMaybeResult.SameValue);
     AssertMaybe.Behavior(42, x => x.Select(y => 5), AssertMaybeResult.Value);
 }
예제 #4
0
 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);
 }
예제 #5
0
 public void Return_ReturnsValueWrapedInMaybe()
 {
     AssertMaybe.Behavior(42, (Expression <Func <int, IMaybe> >)(x => Maybe.Return(x)), AssertMaybeResult.SameValue);
 }