public void TranslateMethodShouldReturnARoverInputObjectContainingTheTranslatedCommands()
        {
            var expectedRoverInput = new NavigationCommand(new List<InputCommand> { InputCommand.Left, InputCommand.Move, InputCommand.Right });
            var sut = new ReceivedMessageTransaltor();
            var actualRoverInput = sut.Translate("LMR");

            Assert.AreEqual(expectedRoverInput.Commands, actualRoverInput.Commands);
        }
Esempio n. 2
0
        internal void ExecuteNavigationCommand(NavigationCommand command)
        {
            _positionController.SetBounds(command.Plateau);

            foreach (var navCommand in command.Commands)
            {
                if (navCommand == InputCommand.Move)
                    _positionController.ProgressPosition();
                else
                    _positionController.AdjustHeading(GetHeadingAdjustment(navCommand));
            }
        }
        public void RoverInputShouldContainACollectionOfInputCommands()
        {
            var sut = new NavigationCommand(new List<InputCommand>());

            Assert.IsInstanceOf<IEnumerable<InputCommand>>(sut.Commands);
        }
        public void RoverInputShouldBeInitializedWithACollectionOfInputCommands()
        {
            var sut = new NavigationCommand(new List<InputCommand>());

            Assert.Pass();
        }