Exemplo n.º 1
0
        public void ChargeLessThan100Test()
        {
            //Arrange
            EmptyMobile MyMobile = new EmptyMobile();

            MyMobile.Battery = new Battery();
            MyMobile.Battery.BatteryCharger = BatteryChargerFactoty.GetBatteryType("BatteryChargerWithTreads");
            //Act

            MyMobile.Battery.BatteryCharger.Charger = 105;

            //Assert
            Assert.IsTrue(MyMobile.Battery.BatteryCharger.Charger <= 100);
        }
Exemplo n.º 2
0
        public void ChargeMoreThen0Test()
        {
            //Arrange
            EmptyMobile MyMobile = new EmptyMobile();

            MyMobile.Battery = new Battery();
            MyMobile.Battery.BatteryCharger = BatteryChargerFactoty.GetBatteryType("BatteryChargerWithTreads");
            //Act

            MyMobile.Battery.BatteryCharger.Charger = -10;

            //Assert
            Assert.IsTrue(MyMobile.Battery.BatteryCharger.Charger >= 0);
        }
Exemplo n.º 3
0
        public SMSReceiverForm()
        {
            InitializeComponent();
            comboBox1.SelectedIndex = 0;
            dateTimePicker1.Value   = DateTime.Now.AddDays(-1);
            dateTimePicker2.Value   = DateTime.Now.AddDays(1);

            MyMobile = new SimCorpMobile();
            output   = new WFAOutputRichTextBox(richTextBox1);
            MyMobile.Storage.SMSAdded   += (message) => FormatAndFilter();
            MyMobile.Storage.SMSAdded   += (message) => MyMobile.Storage.LogAdd(storageLogTextBox, message);
            MyMobile.Storage.SMSAdded   += (message) => myReceivedMessages.Add(message);
            MyMobile.Storage.SMSAdded   += (message) => MyMobile.SMSProvider.addUserToComboBox(comboBox2, message);
            MyMobile.Storage.SMSRemoved += (message) => MyMobile.Storage.LogRemove(storageLogTextBox, message);

            // MyMobile.Battery.BatteryCharger = BatteryChargerFactoty.GetBatteryType("BatteryChargerWithTreads");
            MyMobile.Battery.BatteryCharger         = BatteryChargerFactoty.GetBatteryType("BatteryChargerWithTask");
            MyMobile.Battery.BatteryCharger.Charger = 100;
            MyMobile.Battery.BatteryCharger.executeCharge(checkBoxCharge, progressBarCharge);
        }
        public void ChargerDecreaseWithTasksTest()
        {
            //Arrange
            EmptyMobile MyMobile = new EmptyMobile();

            MyMobile.Battery = new Battery();
            MyMobile.Battery.BatteryCharger = BatteryChargerFactoty.GetBatteryType("BatteryChargerWithTask");
            int initialChargeValue = 95;

            CheckBox    checkBoxCharge    = new CheckBox();
            ProgressBar progressBarCharge = new ProgressBar();

            //Act
            checkBoxCharge.Checked = false;
            MyMobile.Battery.BatteryCharger.Charger = initialChargeValue;
            MyMobile.Battery.BatteryCharger.executeCharge(checkBoxCharge, progressBarCharge);
            Thread.Sleep(3000);

            //Arrange
            Assert.IsTrue(initialChargeValue > MyMobile.Battery.BatteryCharger.Charger);
        }
Exemplo n.º 5
0
        public void ChargerIncreasesWithThreadsTest()
        {
            //Arrange
            EmptyMobile MyMobile = new EmptyMobile();

            MyMobile.Battery = new Battery();
            MyMobile.Battery.BatteryCharger = BatteryChargerFactoty.GetBatteryType("BatteryChargerWithTreads");
            int initialChargeValue = 0;

            CheckBox    checkBoxCharge    = new CheckBox();
            ProgressBar progressBarCharge = new ProgressBar();

            //Act
            checkBoxCharge.Checked = true;
            MyMobile.Battery.BatteryCharger.Charger = initialChargeValue;
            MyMobile.Battery.BatteryCharger.executeCharge(checkBoxCharge, progressBarCharge);
            //Thread.Sleep(1000);

            //Arrange
            Assert.IsTrue(initialChargeValue < MyMobile.Battery.BatteryCharger.Charger);
        }