public void TestPop() { var state = new Turtle.TurtleState(new Vector(2, 2), Math.PI / 4, Colors.Black); var stack = ImmutableStack<Turtle.TurtleState>.Empty.Push(state); var turtle = new Turtle(new Vector(0, 0), 0.0, stack, dummy, Colors.Black); var popped = turtle.Pop(); Assert.AreEqual(popped.Position, state.Position); Assert.AreEqual(popped.Angle, state.Angle); Assert.AreEqual(popped.DrawColor, state.DrawColor); }
public void TestBadPop() { var turtle = new Turtle(new Vector(0, 0), 0.0, ImmutableStack<Turtle.TurtleState>.Empty, dummy, Colors.Black); turtle.Pop(); }