Beispiel #1
0
        private void applyUsbBtn_Click(object sender, EventArgs e)
        {
            mobileOutBox.Clear();
            RadioButton checkedButton = usbAccessGrp.Controls.OfType <RadioButton>().FirstOrDefault(r => r.Checked);

            if (checkedButton != null)
            {
                formInOut.SelectedVariant = checkedButton.Tag.ToString();
            }
            simCorpMobile.SetUsbAccessory();
        }
Beispiel #2
0
        public void SetUsbAccessory()
        {
            fakeInOut.Selected  = 3;
            fakeInOut.FakeWrite = "";
            simCorpMobile.SetUsbAccessory();
            string expectedChoice = "USB Accessory:";

            string[] expectedVariants = { nameof(Charger), nameof(FlashLight), nameof(UsbDisplay) };
            string   expectedOutput   = $"Selected {nameof(UsbDisplay)}" +
                                        $"{nameof(UsbDisplay)} connected to USB, consuming power" +
                                        $"Send data to {nameof(UsbDisplay)}";

            Assert.AreEqual(expectedChoice, fakeInOut.InputChoice);
            Assert.AreEqual(expectedVariants.ToString(), fakeInOut.InputVariants.ToString());
            Assert.AreEqual(expectedOutput, fakeInOut.FakeWrite);
        }