コード例 #1
0
 public void PointOutsideCanvas(int x, int y)
 {
     Canvas.CreateCanvas(1, 1).ConsumeRight(canvas =>
     {
         Assert.AreEqual(
             MaybeFactory.Some(Error.New("point outside canvas")),
             canvas.DrawPoint(Tuple.Create(x, y)));
     });
 }
コード例 #2
0
 public void ConsumeSome()
 {
     MaybeFactory.Some(1)
     .ConsumeNone(Assert.Fail)
     .ConsumeSome(v => Assert.AreEqual(1, v));
 }