Author: calberto
Date: 2007-12-13 19:51:12 -0500 (Thu, 13 Dec 2007)
New Revision: 91264
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBoxTest.cs
Log:
2007-12-13 Carlos Alberto Cortez <[EMAIL PROTECTED]>
* ListBoxTest.cs: Added test for the case when the selected item
is removed.
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2007-12-14 00:50:10 UTC (rev 91263)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2007-12-14 00:51:12 UTC (rev 91264)
@@ -1,3 +1,8 @@
+2007-12-13 Carlos Alberto Cortez <[EMAIL PROTECTED]>
+
+ * ListBoxTest.cs: Added test for the case when the selected item
+ is removed.
+
2007-12-13 Jonathan Pobst <[EMAIL PROTECTED]>
* TableLayoutTest.cs: Add tests for bug #346246.
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
2007-12-14 00:50:10 UTC (rev 91263)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBoxTest.cs
2007-12-14 00:51:12 UTC (rev 91264)
@@ -291,6 +291,26 @@
}
[Test]
+ public void SelectedIndex_Removed ()
+ {
+ ListBox listBox = new ListBox ();
+ listBox.Items.Add ("A");
+ listBox.Items.Add ("B");
+ listBox.Items.Add ("C");
+
+ Assert.AreEqual (-1, listBox.SelectedIndex, "#1");
+ listBox.SelectedIndex = 2;
+ Assert.AreEqual (2, listBox.SelectedIndex, "#2");
+ listBox.Items.RemoveAt (2);
+ Assert.AreEqual (-1, listBox.SelectedIndex, "#3");
+
+ listBox.SelectedIndex = 0;
+ Assert.AreEqual (0, listBox.SelectedIndex, "#4");
+ listBox.Items.RemoveAt (0);
+ Assert.AreEqual (-1, listBox.SelectedIndex, "#5");
+ }
+
+ [Test]
[ExpectedException (typeof (ArgumentOutOfRangeException))]
public void SelectedIndexException ()
{
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches