public void AddMarsRover_Should_Add_Mars_Rover_Plateau_When_Second_Expected_Value()
        {
            //Arrange
            var plateauService = new PlateauService(_loggerMock);

            plateauService.Create(6, 6);
            plateauService.AddMarsRover(new RoverPositionModel
            {
                Direction = Direction.East,
                X         = 5,
                Y         = 3
            });

            var roverPositionModel = new RoverPositionModel
            {
                Direction = Direction.East,
                X         = 1,
                Y         = 2
            };


            //Act
            plateauService.AddMarsRover(roverPositionModel);
            //Assert

            plateauService.GetMarsRovers().Count.Should().Be(2);
            plateauService.GetMarsRovers().Last().X.Should().Be(roverPositionModel.X);
            plateauService.GetMarsRovers().Last().Y.Should().Be(roverPositionModel.Y);
            plateauService.GetMarsRovers().Last().Direction.Should().Be(roverPositionModel.Direction);
        }
Example #2
0
        public void AddMarsRover_Should_Add_Mars_Rover_Plateau_When_One_Expected_Value()
        {
            //Given
            _plateauService.Create(6, 6);
            //When
            _plateauService.AddMarsRover(_roverPositionModel);

            //Than
            Assert.AreEqual(_plateauService.GetMarsRovers().Count, 1);
            Assert.AreEqual(_plateauService.GetMarsRovers().Last().X, _roverPositionModel.X);
            Assert.AreEqual(_plateauService.GetMarsRovers().Last().Y, _roverPositionModel.Y);
            Assert.AreEqual(_plateauService.GetMarsRovers().Last().Direction, _roverPositionModel.Direction);
        }