public void TestVWG_DeselectButtonStateAtSet()
        {
            //---------------Set up test pack-------------------
            IMultiSelector <TestT> _selector = GetControlFactory().CreateMultiSelector <TestT>();
            List <TestT>           options   = CreateListWithTwoOptions();

            _selector.AllOptions = options;
            //---------------Execute Test ----------------------
            _selector.SelectedOptions = options;
            //---------------Test Result -----------------------
            Assert.IsTrue(_selector.GetButton(MultiSelectorButton.Deselect).Enabled);
        }
        public void TestVWG_ClickSelectButtonWithNoItemSelected()
        {
            //---------------Set up test pack-------------------
            IMultiSelector <TestT> _selector = GetControlFactory().CreateMultiSelector <TestT>();

            _selector.AllOptions = CreateListWithTwoOptions();
            _selector.AvailableOptionsListBox.SelectedIndex = -1;
            //---------------Execute Test ----------------------
            _selector.GetButton(MultiSelectorButton.Select).PerformClick();
            //---------------Test Result -----------------------
            AssertNoneSelected(_selector);
        }
        public void TestVWG_SelectButtonIsEnabledWhenItemIsDeselected()
        {
            //---------------Set up test pack-------------------
            IMultiSelector <TestT> _selector = GetControlFactory().CreateMultiSelector <TestT>();

            _selector.AllOptions = CreateListWithTwoOptions();
            _selector.AvailableOptionsListBox.SelectedIndex = 0;
            //---------------Execute Test ----------------------
            _selector.AvailableOptionsListBox.SelectedIndex = -1;
            //---------------Test Result -----------------------
            Assert.IsTrue(_selector.GetButton(MultiSelectorButton.Select).Enabled);
        }
Esempio n. 4
0
        public void Test_Win_SelectButtonStateAtSet()
        {
            //---------------Set up test pack-------------------
            IMultiSelector <TestT> _selector = GetControlFactory().CreateMultiSelector <TestT>();

            //---------------Execute Test ----------------------
            _selector.AllOptions = CreateListWithTwoOptions();

            //---------------Test Result -----------------------
            Assert.IsFalse(_selector.GetButton(MultiSelectorButton.Select).Enabled);
            //---------------Tear Down -------------------------
        }
Esempio n. 5
0
        public void TestDeselectAllButton_click()
        {
            //---------------Set up test pack-------------------
            IMultiSelector <TestT> _selector = GetControlFactory().CreateMultiSelector <TestT>();

            _selector.AllOptions = CreateListWithTwoOptions();
            _selector.Model.SelectAll();

            //---------------Execute Test ----------------------
            _selector.GetButton(MultiSelectorButton.DeselectAll).PerformClick();
            //---------------Test Result -----------------------
            AssertNoneSelected(_selector);
            //---------------Tear Down -------------------------
        }
Esempio n. 6
0
        public void Test_Win_SelectButtonStateUponSelection()
        {
            //---------------Set up test pack-------------------
            IMultiSelector <TestT> _selector = GetControlFactory().CreateMultiSelector <TestT>();

            _selector.AllOptions = CreateListWithTwoOptions();
            //---------------Execute Test ----------------------

            _selector.AvailableOptionsListBox.SelectedIndex = 0;

            //---------------Test Result -----------------------
            Assert.IsTrue(_selector.GetButton(MultiSelectorButton.Select).Enabled);
            //---------------Tear Down -------------------------
        }
Esempio n. 7
0
        public void Test_Win_DeselectButtonIsDisabledWhenItemIsDeselected()
        {
            //---------------Set up test pack-------------------
            IMultiSelector <TestT> _selector = GetControlFactory().CreateMultiSelector <TestT>();
            List <TestT>           options   = CreateListWithTwoOptions();

            _selector.AllOptions      = options;
            _selector.SelectedOptions = options;
            _selector.SelectedOptionsListBox.SelectedIndex = 0;
            //---------------Execute Test ----------------------
            _selector.SelectedOptionsListBox.SelectedIndex = -1;
            //---------------Test Result -----------------------
            Assert.IsFalse(_selector.GetButton(MultiSelectorButton.Deselect).Enabled);
            //---------------Tear Down -------------------------
        }
Esempio n. 8
0
        public void TestDeselectButtonUpdatesListboxes_Click()
        {
            //---------------Set up test pack-------------------
            IMultiSelector <TestT> _selector = GetControlFactory().CreateMultiSelector <TestT>();

            _selector.AllOptions = CreateListWithTwoOptions();
            _selector.Model.Select(_selector.Model.OptionsView[0]);
            _selector.SelectedOptionsListBox.SelectedIndex = 0;

            //---------------Execute Test ----------------------
            _selector.GetButton(MultiSelectorButton.Deselect).PerformClick();
            //---------------Test Result -----------------------

            AssertNoneSelected(_selector);
            //---------------Tear Down -------------------------
        }
Esempio n. 9
0
        public virtual void TestDeselectingMultipleItemsAtOnce_Click()
        {
            //---------------Set up test pack-------------------
            IMultiSelector <TestT> _selector = GetControlFactory().CreateMultiSelector <TestT>();
            List <TestT>           options   = CreateListWithTwoOptions();

            _selector.AllOptions = options;
            _selector.Model.SelectAll();
            _selector.SelectedOptionsListBox.SelectedItems.Add(options[0]);
            _selector.SelectedOptionsListBox.SelectedItems.Add(options[1]);
            //---------------Execute Test ----------------------
            _selector.GetButton(MultiSelectorButton.Deselect).PerformClick();

            //---------------Test Result -----------------------
            AssertNoneSelected(_selector);
            //---------------Tear Down -------------------------
        }
Esempio n. 10
0
        public void TestSelectButton_Click()
        {
            //---------------Set up test pack-------------------
            IMultiSelector <TestT> _selector = GetControlFactory().CreateMultiSelector <TestT>();

            _selector.AllOptions = CreateListWithTwoOptions();
            _selector.AvailableOptionsListBox.SelectedIndex = 0;

            //---------------Execute Test ----------------------
            _selector.GetButton(MultiSelectorButton.Select).PerformClick();

            //---------------Test Result -----------------------
            Assert.AreEqual(1, _selector.AvailableOptionsListBox.Items.Count);
            Assert.AreEqual(1, _selector.SelectedOptionsListBox.Items.Count);
            Assert.AreEqual(_selector.SelectedOptionsListBox.Items.Count, _selector.SelectionsView.Count);
            //---------------Tear Down -------------------------
        }
Esempio n. 11
0
        public virtual void TestSelectingMultipleItemsAtOnce_Click()
        {
            //---------------Set up test pack-------------------
            IMultiSelector <TestT> _selector = GetControlFactory().CreateMultiSelector <TestT>();

            _selector.AllOptions = CreateListWithTwoOptions();
            ReadOnlyCollection <TestT> options = _selector.Model.OptionsView;
            IListBox availableOptionsListbox   = _selector.AvailableOptionsListBox;

            availableOptionsListbox.SelectedItems.Add(options[0]);
            availableOptionsListbox.SelectedItems.Add(options[1]);

            //---------------Execute Test ----------------------
            _selector.GetButton(MultiSelectorButton.Select).PerformClick();

            //---------------Test Result -----------------------
            AssertAllSelected(_selector);
            Assert.AreEqual(_selector.SelectedOptionsListBox.Items.Count, _selector.SelectionsView.Count);
            //---------------Tear Down -------------------------
        }
Esempio n. 12
0
        public virtual void TestSelectingIListBoxItemsCollectionEnumerator()
        {
            //---------------Set up test pack-------------------
            IMultiSelector <TestT> _selector = GetControlFactory().CreateMultiSelector <TestT>();

            _selector.AllOptions = CreateListWithTwoOptions();
            ReadOnlyCollection <TestT> options = _selector.Model.OptionsView;
            IListBox availableOptionsListbox   = _selector.AvailableOptionsListBox;

            availableOptionsListbox.SelectedItems.Add(options[0]);
            availableOptionsListbox.SelectedItems.Add(options[1]);

            //---------------Execute Test ----------------------
            _selector.GetButton(MultiSelectorButton.Select).PerformClick();

            //---------------Test Result -----------------------
            foreach (object o in _selector.SelectedOptionsListBox.Items)
            {
                Assert.IsNotNull(o);
            }
            //---------------Tear Down -------------------------
        }
 /// <summary>
 /// See <see cref="IMultiSelector{T}.GetButton"/>
 /// </summary>
 private IButton GetButton(MultiSelectorButton buttonType)
 {
     return(_multiSelector.GetButton(buttonType));
 }