public void SimCorpMobilePhoneTestHighChargeThresholdByTask()
        {
            int max_charge         = 100;
            SimCorpMobilePhone mob = new SimCorpMobilePhone(JobType.Task, currentCharge: max_charge, maxCharge: max_charge);
            int ellapsedTime       = 1;// generate charge event every 1ms

            mob.SetEllapsedTimes(chargeBatteryTime: ellapsedTime, unchargeBatteryTime: 10000000);
            mob.StartCharging();

            //uncharging is activated automaticly but with grate amount of ellapsed time.
            //charging is activated too with period of 1 ms.
            bool checkFlag = true;

            Thread.Sleep(1000 * ellapsedTime);
            checkFlag &= mob.GetCurrentStateOfCharge() <= max_charge;
            Thread.Sleep(2000 * ellapsedTime);
            checkFlag &= mob.GetCurrentStateOfCharge() <= max_charge;
            Thread.Sleep(3000 * ellapsedTime);
            checkFlag &= mob.GetCurrentStateOfCharge() <= max_charge;

            Assert.AreEqual(checkFlag, true);
        }
        public void SimCorpMobilePhoneTestLowChargeThresholdByTask()
        {
            int max_charge         = 100;
            SimCorpMobilePhone mob = new SimCorpMobilePhone(JobType.Task, currentCharge: 0, maxCharge: max_charge);
            int ellapsedTime       = 1000;// generate uncharge event every 1s

            mob.SetEllapsedTimes(unchargeBatteryTime: ellapsedTime);

            //uncharging is activated automaticly.
            //charging is not activated.
            bool checkFlag = true;

            Thread.Sleep(ellapsedTime);
            checkFlag &= mob.GetCurrentStateOfCharge() == 0;
            Thread.Sleep(ellapsedTime);
            checkFlag &= mob.GetCurrentStateOfCharge() == 0;
            Thread.Sleep(ellapsedTime);
            checkFlag &= mob.GetCurrentStateOfCharge() == 0;

            Assert.AreEqual(checkFlag, true);

            mob.Dispose();
        }