public void should_have_correct_positions()
        {
            var expected = new[]
            {
                Position.From(1, 3, CardinalCompassPoint.North()),
                Position.From(5, 1, CardinalCompassPoint.East())
            };

            Assert.That(_finalRobotPositions, Is.EqualTo(expected));
        }
 public Arena Parse(string[] input)
 {
     Input = input;
     return(Arena.From(GridSize.From(5, 5),
                       new[]
     {
         Robot.From(Position.From(0, 0, CardinalCompassPoint.North()),
                    Route.From(new[]
         {
             RouteStep.RotateRight90Degrees(),
             RouteStep.MoveOneGridSpace(),
             RouteStep.RotateLeft90Degrees()
         }))
     }
                       ));
 }
        public void should_have_correct_gridsize_and_robots()
        {
            var expected = Arena.From
                               (GridSize.From(5, 6),
                               new[]
            {
                Robot.From
                    (Position.From(0, 1, CardinalCompassPoint.North()),
                    Route.From(new[]
                {
                    RouteStep.RotateRight90Degrees(),
                    RouteStep.MoveOneGridSpace(),
                    RouteStep.RotateLeft90Degrees(),
                    RouteStep.MoveOneGridSpace(),
                    RouteStep.RotateRight90Degrees(),
                    RouteStep.MoveOneGridSpace(),
                    RouteStep.RotateLeft90Degrees(),
                    RouteStep.MoveOneGridSpace()
                }))
            });

            Assert.That(_arena, Is.EqualTo(expected));
        }
Пример #4
0
        public void should_have_correct_coordinates_and_cardinalcompasspoint()
        {
            var expected = Position.From(5, 6, CardinalCompassPoint.North());

            Assert.That(_position, Is.EqualTo(expected));
        }
 public CardinalCompassPoint Resolve(char input)
 {
     return(input == 'N' ? CardinalCompassPoint.North() : null);
 }