Esempio n. 1
0
        public void CommandMove_FacingNorthAndAtTopOfGrid_ThrowsException()
        {
            // arrange
            IGrid grid = new Grid(5,5);
            IRobot robot = new Robot(0, 4, OrientationEnum.North, fiveByFiveGrid);
            grid.Add(robot);

            // act
            robot.CommandMove();
        }
Esempio n. 2
0
        public void CommandMove_FacingEastAndAtFarRightOfGrid_ThrowsException()
        {
            // arrange
            IGrid grid = new Grid(5, 5);
            IRobot robot = new Robot(4, 0, OrientationEnum.East, grid);
            grid.Add(robot);

            // act
            robot.CommandMove();
        }
Esempio n. 3
0
        public void CommandMove_FacingEast_IncrementX()
        {
            // arrange
            IRobot robot = new Robot(0, 0, OrientationEnum.East, fiveByFiveGrid);

            // act
            robot.CommandMove();

            // assert
            Assert.That(robot.X, Is.EqualTo(1));
            Assert.That(robot.Y, Is.EqualTo(0));
        }
Esempio n. 4
0
        public void CommandMove_FacingSouthAndAtBottomOfGrid_ThrowsException()
        {
            // arrange
            IGrid grid = new Grid(5, 5);
            IRobot robot = new Robot(0, 0, OrientationEnum.South, grid);
            grid.Add(robot);

            // act
            robot.CommandMove();
        }
Esempio n. 5
0
        public void CommandMove_FacingSouth_DecrementY()
        {
            // arrange
            IRobot robot = new Robot(1, 1, OrientationEnum.South, fiveByFiveGrid);

            // act
            robot.CommandMove();

            // assert
            Assert.That(robot.X, Is.EqualTo(1));
            Assert.That(robot.Y, Is.EqualTo(0));
        }