Пример #1
0
        private void performFromSelectionAfterToSelectedTest(int fromSetting, int toSetting)
        {
            LineupMgrDlg dlg    = new LineupMgrDlg(true);
            ComboBox     cbFROM = new ComboBox();
            ComboBox     cbTO   = new ComboBox();

            Assert.AreEqual(0, cbFROM.Items.Count);
            Assert.AreEqual(0, cbTO.Items.Count);

            dlg.populateComboBoxes(cbFROM, cbTO, null);

            Assert.AreEqual(19, cbFROM.Items.Count);
            Assert.AreEqual(19, cbTO.Items.Count);

            // Pre Select TO
            cbTO.SelectedIndex = toSetting;
            dlg.populateComboBoxes(cbFROM, cbTO, cbTO);

            // User selects FROM
            cbFROM.SelectedIndex = fromSetting;
            dlg.populateComboBoxes(cbFROM, cbTO, cbFROM);

            int from = cbFROM.Items.Count;
            int to   = cbTO.Items.Count;

            String sFrom = ((LineupBalanceItem)cbFROM.SelectedItem).ToString();
            String sTo   = ((LineupBalanceItem)cbTO.SelectedItem).ToString();

            return;
        }
Пример #2
0
        private void performToSelectionTest(int toSetting, int extectedFromCount)
        {
            LineupMgrDlg dlg    = new LineupMgrDlg(true);
            ComboBox     cbFROM = new ComboBox();
            ComboBox     cbTO   = new ComboBox();

            Assert.AreEqual(0, cbFROM.Items.Count);
            Assert.AreEqual(0, cbTO.Items.Count);

            dlg.populateComboBoxes(cbFROM, cbTO, null);

            Assert.AreEqual(19, cbFROM.Items.Count);
            Assert.AreEqual(19, cbTO.Items.Count);

            if (toSetting != -1)
            {
                cbTO.SelectedIndex = toSetting;
                dlg.populateComboBoxes(cbFROM, cbTO, cbTO);
            }
            Assert.AreEqual(extectedFromCount, cbFROM.Items.Count);
            Assert.AreEqual(FULL_CB, cbTO.Items.Count);
        }