Exemplo n.º 1
0
        public void AddRoverToList(RoverDto roverDto)
        {
            var plateu = PlateuFactory.CreatePlateu(roverDto.Plateu.CoordinateX, roverDto.Plateu.CoordinateY);
            var rover  = RoverFactory.CreateRover(roverDto.Id, roverDto.CoordinateX, roverDto.CoordinateY, roverDto.Direction, roverDto.Command, plateu);

            rovers.Add(rover);
        }
Exemplo n.º 2
0
        public void Test_Move_Rover(int plateuXCoordinate, int plateuYCoordinate, int roverId, int coordinateX, int coordinateY, char direction, string command, int expectedX, int expectedY, Type expectedDirection, bool isOutOfThePlateu)
        {
            var plateu = PlateuFactory.CreatePlateu(plateuXCoordinate, plateuYCoordinate);
            var rover  = RoverFactory.CreateRover(roverId, coordinateX, coordinateY, direction, command, plateu);

            rover.Move();

            Assert.Equal(expectedX, rover.CoordinateX);
            Assert.Equal(expectedY, rover.CoordinateY);
            Assert.Equal(expectedDirection, rover.Direction.GetType());
            Assert.Equal(isOutOfThePlateu, rover.IsOutOfThePlateu);
        }