Example #1
0
        public void GoForwardButNowIsHeadingSouthEdgeShouldThrowException()
        {
            IPosition position = new Position(0, 0);
            IHeading heading = new HeadingSouth();
            IList<char> MovingInstruction = new List<char>();
            MovingInstruction.Add('M');

            var robot = new Robot(0, position, heading, MovingInstruction, _targetPlateau);
            robot.Move();
        }
Example #2
0
        public void GoForwardToSouth()
        {
            IPosition position = new Position(1, 2);
            IHeading heading = new HeadingSouth();
            IList<char> MovingInstruction = new List<char>();
            MovingInstruction.Add('M');

            var robot = new Robot(0, position, heading, MovingInstruction, _targetPlateau);
            robot.Move();

            Assert.AreEqual(1, robot.CurrentPosition.X);
            Assert.AreEqual(1, robot.CurrentPosition.Y);
            Assert.AreEqual(typeof(HeadingSouth), robot.Heading.GetType());
        }