Beispiel #1
0
        public void ChargeLevelNegativeTest()
        {
            MobileLab5       mob     = new MobileLab5(new SmsReceiver());
            BatteryWithTasks battery = new BatteryWithTasks();

            battery.ChargeLevel = 0;

            battery.StartThreads(new ProgressBar());
            Thread.Sleep(3500);

            Assert.IsTrue(battery.ChargeLevel == 0);
        }
Beispiel #2
0
        public void BatteryUsingWithTasksTest()
        {
            MobileLab5       mob     = new MobileLab5(new SmsReceiver());
            BatteryWithTasks battery = new BatteryWithTasks();
            int startingChargeLevel  = battery.ChargeLevel;

            battery.StartThreads(new ProgressBar());
            Thread.Sleep(3500);

            bool expectedTrue = startingChargeLevel > battery.ChargeLevel;

            expectedTrue = expectedTrue && (startingChargeLevel - 5) < battery.ChargeLevel;
            Assert.IsTrue(expectedTrue);
        }