Esempio n. 1
0
        public void CommandReturnsFalse()
        {
            _mockDroneCommands.Setup(x => x.Command()).Returns(false);
            var drone = new Drone(_mockDroneCommands.Object);

            Assert.AreEqual(false, drone.Command());
            _mockDroneCommands.Verify(x => x.Command(), Times.Once);
        }
Esempio n. 2
0
        private bool SetUpDrone(int retryCount)
        {
            var inCommandMode = false;

            while (inCommandMode != true && retryCount > 0)
            {
                inCommandMode = _drone.Command();
                retryCount--;
            }

            if (!inCommandMode)
            {
                return(false);
            }
            _drone.TakeOff();
            return(true);
        }