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); }
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 ------------------------- }
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 ------------------------- }
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 ------------------------- }
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 ------------------------- }
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 ------------------------- }
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 ------------------------- }
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 ------------------------- }
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 ------------------------- }
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)); }