Author: toshok
Date: 2006-10-31 17:11:56 -0500 (Tue, 31 Oct 2006)
New Revision: 67194
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBoxTest.cs
Log:
flesh out a couple of these tests
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBoxTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBoxTest.cs
2006-10-31 21:44:10 UTC (rev 67193)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBoxTest.cs
2006-10-31 22:11:56 UTC (rev 67194)
@@ -242,6 +242,13 @@
}
[Test]
+ [ExpectedException (typeof (ArgumentOutOfRangeException))]
+ public void SelectedIndexException2 ()
+ {
+ listBox.SelectedIndex = listBox.Items.Count;
+ }
+
+ [Test]
[ExpectedException (typeof (ArgumentException))]
public void SelectedIndexModeNoneException ()
{
@@ -259,13 +266,31 @@
[Test]
public void SelectedValueNull()
{
+ listBox.Items.Clear ();
+
+ listBox.Items.Add ("A");
+ listBox.Items.Add ("B");
+ listBox.Items.Add ("C");
+ listBox.Items.Add ("D");
+
+ listBox.SelectedIndex = 2;
listBox.SelectedValue = null;
+ Assert.AreEqual (listBox.SelectedIndex, 2);
}
[Test]
public void SelectedValueEmptyString()
{
- listBox.SelectedValue = String.Empty;
+ listBox.Items.Clear ();
+
+ listBox.Items.Add ("A");
+ listBox.Items.Add ("B");
+ listBox.Items.Add ("C");
+ listBox.Items.Add ("D");
+
+ listBox.SelectedIndex = 2;
+ listBox.SelectedValue = null;
+ Assert.AreEqual (listBox.SelectedIndex, 2);
}
//
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches