public void EvaluateKey_SpaceDown_EvaluatedAsLandCommand()
        {
            var expectedCommand  = new LandCommand();
            var landKeyInfo      = new KeyInfo(Key.Space, KeyState.Down);
            var commandEvaluated = this.generalKeyInputEvaluator.EvaluateKey(landKeyInfo);

            Assert.Equal(expectedCommand, commandEvaluated);
        }
Пример #2
0
        /// <summary>
        /// Makes from a string and value a command
        /// </summary>
        /// <param name="command"></param>
        /// <param name="value"></param>
        /// <returns>Command</returns>
        public IDroneCommand makeCommand(string command, double value = 0)
        {
            IDroneCommand droneCommand = null;

            if (command.Equals("Start"))
            {
                droneCommand = new StartCommand(_droneController);
            }
            else if (command.Equals("Land"))
            {
                droneCommand = new LandCommand(_droneController);
            }
            else if (command.Equals("Rise"))
            {
                droneCommand = new RiseCommand(_droneController, value);
            }
            else if (command.Equals("Fall"))
            {
                droneCommand = new FallCommand(_droneController, value);
            }
            else if (command.Equals("Right"))
            {
                droneCommand = new RightCommand(_droneController, value);
            }
            else if (command.Equals("Left"))
            {
                droneCommand = new LeftCommand(_droneController, value);
            }
            else if (command.Equals("Forward"))
            {
                droneCommand = new ForwardCommand(_droneController, value);
            }
            else if (command.Equals("Backward"))
            {
                droneCommand = new BackwardCommand(_droneController, value);
            }
            else if (command.Equals("Turn"))
            {
                droneCommand = new TurnCommand(_droneController, (int)value);
            }
            else if (command.Equals("TakePicture"))
            {
                droneCommand = new TakePictureCommand(_droneController, (int)value);
            }
            else if (command.Equals("FollowLine"))
            {
                droneCommand = new FollowLineCommand(_droneController);
            }

            return(droneCommand);
        }
Пример #3
0
        public void Equals_ComparandIsLandCommandWithDroneCommandReference_ReturnsTrue()
        {
            DroneCommand comparand = new LandCommand();

            Assert.True(this.landCommand.Equals(comparand));
        }
Пример #4
0
 public LandCommandTests()
 {
     this.landCommand = new LandCommand();
 }
Пример #5
0
        public void Equals_ComparandIsLandCommand_ReturnsTrue()
        {
            var comparand = new LandCommand();

            Assert.True(this.landCommand.Equals(comparand));
        }