示例#1
0
        public void SingleSelectBox()
        {
            Form form = new ListBoxTestForm();

            form.Show();
            TestWriter writer = new TestWriter(form);

            Assert.AreEqual("", writer.Test);

            ListBoxTester myListBox = new ListBoxTester("mySingleSelectBox", form);

            myListBox.ClearSelected();
            myListBox.SetSelected(0, true); //Red
            myListBox.SetSelected(2, true); //Yellow
            myListBox.SetSelected(4, true); //Blue
            myListBox.SetSelected(6, true); //Violet

            Assert.AreEqual(
                @"[Test]
public void Test()
{

	ListBoxTester mySingleSelectBox = new ListBoxTester(""mySingleSelectBox"");

	mySingleSelectBox.Select(0); //Can
	mySingleSelectBox.Select(2); //Select
	mySingleSelectBox.Select(4); //At
	mySingleSelectBox.Select(6); //Time

}",
                writer.Test);
        }
示例#2
0
        public void ListBoxSelection()
        {
            LabelTester   myLabel   = new LabelTester("myLabel");
            ListBoxTester myListBox = new ListBoxTester("myListBox");

            myListBox.ClearSelected();

            myListBox.Select(rainbowArray[0]);
            Assert.AreEqual(rainbowArray[0], myLabel.Text);
        }
示例#3
0
        public void MutlipleSelection()
        {
            Form form = new ListBoxTestForm();

            form.Show();
            TestWriter writer = new TestWriter(form);

            Assert.AreEqual("", writer.Test);

            ListBoxTester myListBox = new ListBoxTester("myListBox", form);

            myListBox.ClearSelected();
            myListBox.SetSelected(0, true); //Red
            myListBox.SetSelected(2, true); //Yellow
            myListBox.SetSelected(4, true); //Blue
            myListBox.SetSelected(6, true); //Violet

            Assert.AreEqual(
                @"[Test]
public void Test()
{

	ListBoxTester myListBox = new ListBoxTester(""myListBox"");

	myListBox.ClearSelected();
	myListBox.SetSelected(0, True); //Red
	myListBox.ClearSelected();
	myListBox.SetSelected(0, True); //Red
	myListBox.SetSelected(2, True); //Yellow
	myListBox.ClearSelected();
	myListBox.SetSelected(0, True); //Red
	myListBox.SetSelected(2, True); //Yellow
	myListBox.SetSelected(4, True); //Blue
	myListBox.ClearSelected();
	myListBox.SetSelected(0, True); //Red
	myListBox.SetSelected(2, True); //Yellow
	myListBox.SetSelected(4, True); //Blue
	myListBox.SetSelected(6, True); //Violet

}",
                writer.Test);
        }
示例#4
0
        public void MutlipleSelection()
        {
            Form form = new ListBoxTestForm();
            form.Show();
            TestWriter writer = new TestWriter(form);
            Assert.AreEqual("", writer.Test);

            ListBoxTester myListBox = new ListBoxTester("myListBox", form);

            myListBox.ClearSelected();
            myListBox.SetSelected(0, true); //Red
            myListBox.SetSelected(2, true); //Yellow
            myListBox.SetSelected(4, true); //Blue
            myListBox.SetSelected(6, true); //Violet

            Assert.AreEqual(
                    @"[Test]
            public void Test()
            {

            ListBoxTester myListBox = new ListBoxTester(""myListBox"");

            myListBox.ClearSelected();
            myListBox.SetSelected(0, True); //Red
            myListBox.ClearSelected();
            myListBox.SetSelected(0, True); //Red
            myListBox.SetSelected(2, True); //Yellow
            myListBox.ClearSelected();
            myListBox.SetSelected(0, True); //Red
            myListBox.SetSelected(2, True); //Yellow
            myListBox.SetSelected(4, True); //Blue
            myListBox.ClearSelected();
            myListBox.SetSelected(0, True); //Red
            myListBox.SetSelected(2, True); //Yellow
            myListBox.SetSelected(4, True); //Blue
            myListBox.SetSelected(6, True); //Violet

            }",
                    writer.Test);
        }
示例#5
0
        public void ListBoxMultiSelection()
        {
            ListBoxTester myListBox = new ListBoxTester("myListBox");

            string[] alternateColors = new string[] {"Red", "Yellow", "Blue", "Violet"};
            StringCollection alternates = new StringCollection();
            alternates.AddRange(alternateColors);

            myListBox.ClearSelected();

            foreach(string color in alternates)
            {
                myListBox.SetSelected(color, true);
            }

            Assert.AreEqual(4, myListBox.Properties.SelectedItems.Count);

            foreach(object selectedItem in myListBox.Properties.SelectedItems)
            {
                Assert.IsTrue(alternates.Contains(Convert.ToString(selectedItem)));
            }
        }
示例#6
0
        public void ListBoxMultiSelection()
        {
            ListBoxTester myListBox = new ListBoxTester("myListBox");

            string[]         alternateColors = new string[] { "Red", "Yellow", "Blue", "Violet" };
            StringCollection alternates      = new StringCollection();

            alternates.AddRange(alternateColors);

            myListBox.ClearSelected();

            foreach (string color in alternates)
            {
                myListBox.SetSelected(color, true);
            }

            Assert.AreEqual(4, myListBox.Properties.SelectedItems.Count);

            foreach (object selectedItem in myListBox.Properties.SelectedItems)
            {
                Assert.IsTrue(alternates.Contains(Convert.ToString(selectedItem)));
            }
        }
示例#7
0
        public void ListBoxSelection()
        {
            LabelTester myLabel = new LabelTester("myLabel");
            ListBoxTester myListBox = new ListBoxTester("myListBox");

            myListBox.ClearSelected();

            myListBox.Select(rainbowArray[0]);
            Assert.AreEqual(rainbowArray[0], myLabel.Text);
        }
示例#8
0
        public void SingleSelectBox()
        {
            Form form = new ListBoxTestForm();
            form.Show();
            TestWriter writer = new TestWriter(form);
            Assert.AreEqual("", writer.Test);

            ListBoxTester myListBox = new ListBoxTester("mySingleSelectBox", form);

            myListBox.ClearSelected();
            myListBox.SetSelected(0, true); //Red
            myListBox.SetSelected(2, true); //Yellow
            myListBox.SetSelected(4, true); //Blue
            myListBox.SetSelected(6, true); //Violet

            Assert.AreEqual(
                    @"[Test]
            public void Test()
            {

            ListBoxTester mySingleSelectBox = new ListBoxTester(""mySingleSelectBox"");

            mySingleSelectBox.Select(0); //Can
            mySingleSelectBox.Select(2); //Select
            mySingleSelectBox.Select(4); //At
            mySingleSelectBox.Select(6); //Time

            }",
                    writer.Test);
        }