Пример #1
0
        public void GoForwardButNowIsHeadingEastEdgeShouldThrowException()
        {
            IPosition position = new Position(5, 5);
            IHeading heading = new HeadingEast();
            IList<char> MovingInstruction = new List<char>();
            MovingInstruction.Add('M');

            var robot = new Robot(0, position, heading, MovingInstruction, _targetPlateau);
            robot.Move();
        }
Пример #2
0
        public void GoForwardToEast()
        {
            IPosition position = new Position(1, 2);
            IHeading heading = new HeadingEast();
            IList<char> MovingInstruction = new List<char>();
            MovingInstruction.Add('M');

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

            Assert.AreEqual(2, robot.CurrentPosition.X);
            Assert.AreEqual(2, robot.CurrentPosition.Y);
            Assert.AreEqual(typeof(HeadingEast), robot.Heading.GetType());
        }