示例#1
0
        public void TurnerByOrientation()
        {
            var turner      = new TurnerClockwise();
            var orientation = Orientation.North;

            orientation = turner.TurnClockwise(orientation);
            Assert.AreEqual(Orientation.West, orientation);

            orientation = turner.TurnClockwise(orientation);
            Assert.AreEqual(Orientation.South, orientation);

            orientation = turner.TurnClockwise(orientation);
            Assert.AreEqual(Orientation.East, orientation);

            orientation = turner.TurnClockwise(orientation);
            Assert.AreEqual(Orientation.North, orientation);
        }
示例#2
0
        public void TurnerByDirection()
        {
            var turner    = new TurnerClockwise();
            var direction = new Point(0, 1);

            turner.TurnClockwise(direction);
            Assert.AreEqual(new Point(-1, 0), direction);

            turner.TurnClockwise(direction);
            Assert.AreEqual(new Point(0, -1), direction);

            turner.TurnClockwise(direction);
            Assert.AreEqual(new Point(1, 0), direction);

            turner.TurnClockwise(direction);
            Assert.AreEqual(new Point(0, 1), direction);
        }