Exemplo n.º 1
0
        public void should_raise_exception()
        {
            var coordinate = new Coordinate("X 2");

            _robot.Commands = new List <Coordinate> {
                coordinate
            };

            var coordinateService = new CoordinateService();

            Assert.Throws <ArgumentException>(() => coordinateService.ExecuteSteps(_robot, coordinate));
        }
Exemplo n.º 2
0
        public void should_move_towards()
        {
            var coordinate = new Coordinate("E 2");

            _robot.Commands = new List <Coordinate> {
                coordinate
            };

            var coordinateService = new CoordinateService();

            coordinateService.ExecuteSteps(_robot, coordinate);

            var expected = new Position(2, 0);

            Assert.AreEqual(_robot.Position.PositionX, expected.PositionX);
            Assert.AreEqual(_robot.Position.PositionY, expected.PositionY);
        }