Example #1
0
        public void WhenActionIsToMoveTheDirectionDoesNotChange()
        {
            // Arrange
            var turtle = new Turtle()
            {
                CurrentPosition = new Position()
                {
                    Position  = new Point(0, 0),
                    Direction = Direction.N
                }
            };

            // Act
            turtle.DoRotate(TurtleAction.M);

            // Assert
            Assert.True(turtle.CurrentPosition.Direction == Direction.N);
        }
Example #2
0
        public void WhenTurtleRotatesFromNorthToEast()
        {
            // Arrange
            var turtle = new Turtle()
            {
                CurrentPosition = new Position()
                {
                    Position  = new Point(0, 0),
                    Direction = Direction.N
                }
            };

            // Act
            turtle.DoRotate(TurtleAction.R);

            // Assert
            Assert.True(turtle.CurrentPosition.Direction == Direction.E);
        }
Example #3
0
        public void WhenTurtleRotatesFromWsetToSouth()
        {
            // Arrange
            var turtle = new Turtle()
            {
                CurrentPosition = new Position()
                {
                    Position  = new Point(0, 0),
                    Direction = Direction.W
                }
            };

            // Act
            turtle.DoRotate(TurtleAction.L);

            // Assert
            Assert.True(turtle.CurrentPosition.Direction == Direction.S);
        }