Пример #1
0
        public void BatteryReceiveDataHasValidDeviceTypeTest()
        {
            //  Given
            BatteryDataReceiver batteryDataReceiver  = new BatteryDataReceiver(roboteQ);
            SelectedDevice      expectedDataReceiver = SelectedDevice.Battery;

            //  When
            SelectedDevice actualDataReceiver = batteryDataReceiver.ReceiveData().SelectedDeviceType;

            //  Then
            Assert.AreEqual(expectedDataReceiver, actualDataReceiver);
        }
Пример #2
0
        public void BatteryReceiveDataIsNotNullTest()
        {
            //  Given
            BatteryDataReceiver batteryDataReceiver = new BatteryDataReceiver(roboteQ);
            string key = "charge";

            //  When
            double batteryCharge = batteryDataReceiver.ReceiveData().Dictionary[key];

            //  Then
            Assert.IsNotNull(batteryCharge);
        }
Пример #3
0
        public void BatteryReceiveDataBetween0And100Test()
        {
            //  Given
            BatteryDataReceiver batteryDataReceiver = new BatteryDataReceiver(roboteQ);
            string key      = "charge";
            int    minValue = 0;
            int    maxValue = 100;

            //  When
            double batteryCharge = batteryDataReceiver.ReceiveData().Dictionary[key];

            //  Then
            Assert.IsTrue(batteryCharge >= minValue && batteryCharge <= maxValue);
        }