Exemplo n.º 1
0
 public void ColorSelectionTest()
 {
     listViewForm.Show();
     listViewDetails.Items.AddRange(ColorList());
     string[] selectedColors = new string[] { "Red", "Violet" };
     listViewDetails.SelectItems(selectedColors);
     Assert.IsTrue(listViewDetails.SelectedItemsMatch(selectedColors));
 }
Exemplo n.º 2
0
        public void AllowSingleSelectonly()
        {
            listViewDetails.Properties.MultiSelect = false;
            listViewDetails.Items.AddRange(ColorList());
            listViewForm.Show();

            string[] selectedColors = new string[] { "Red" };
            listViewDetails.SelectItems(selectedColors);
            Assert.IsTrue(listViewDetails.SelectedItemsMatch(selectedColors));

            selectedColors = new string[] { "Red", "Violet" };
            listViewDetails.SelectItems(selectedColors);
            Assert.IsFalse(listViewDetails.SelectedItemsMatch(selectedColors));
        }