예제 #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);
        }