public void TestTurnRight() { Dictionary <Point, long> scaffolding = new Dictionary <Point, long>(); ScaffoldPathBuilder spb = new ScaffoldPathBuilder(); ScaffoldPathBuilder.Direction dir = ScaffoldPathBuilder.Direction.Up; dir = spb.TurnRight(dir); Assert.That(dir, Is.EqualTo(ScaffoldPathBuilder.Direction.Right)); dir = spb.TurnRight(dir); Assert.That(dir, Is.EqualTo(ScaffoldPathBuilder.Direction.Down)); dir = spb.TurnRight(dir); Assert.That(dir, Is.EqualTo(ScaffoldPathBuilder.Direction.Left)); dir = spb.TurnRight(dir); Assert.That(dir, Is.EqualTo(ScaffoldPathBuilder.Direction.Up)); }
public void TestMoveForward() { Dictionary <Point, long> scaffolding = new Dictionary <Point, long>(); ScaffoldPathBuilder spb = new ScaffoldPathBuilder(); Point pos = new Point(0, 0); ScaffoldPathBuilder.Direction dir = ScaffoldPathBuilder.Direction.Up; scaffolding[new Point(0, -1)] = 35; scaffolding[new Point(0, -2)] = 35; scaffolding[new Point(0, -3)] = 35; scaffolding[new Point(0, -4)] = 35; long steps = spb.MoveForward(scaffolding, ref pos, dir); Assert.That(steps, Is.EqualTo(4)); Assert.That(pos.X, Is.EqualTo(0)); Assert.That(pos.Y, Is.EqualTo(-4)); }