Kaynağa Gözat

2007-04-26 Jonathan Pobst <[email protected]>

	* ToolStripTest.cs: Fix the failing MethodGetNextItem test.

svn path=/trunk/mcs/; revision=76354
Jonathan Pobst 19 yıl önce
ebeveyn
işleme
9cdadd8ec8

+ 4 - 0
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog

@@ -1,3 +1,7 @@
+2007-04-26  Jonathan Pobst  <[email protected]>
+
+	* ToolStripTest.cs: Fix the failing MethodGetNextItem test.
+
 2007-04-25  Rolf Bjarne Kvinge <[email protected]> 
 
 	* FormHandleTest.cs, ControlEventTest.cs, MenuStripTest.cs,

+ 8 - 11
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripTest.cs

@@ -642,22 +642,19 @@ namespace MonoTests.System.Windows.Forms
 			ToolStrip ts = new ToolStrip ();
 			ts.Items.Add ("Test Item 1");
 			
-
-			Assert.AreEqual (null, ts.GetNextItem (null, ArrowDirection.Right), "A1");
-			Assert.AreEqual (null, ts.GetNextItem (ts.Items[0], ArrowDirection.Right), "A2");
-
-			ts.Items.Add ("Test Item 2");
-			Assert.AreEqual (ts.Items[0], ts.GetNextItem (null, ArrowDirection.Right), "A3");
-			Assert.AreEqual (ts.Items[0], ts.GetNextItem (ts.Items[0], ArrowDirection.Right), "A4");
-
 			Form f = new Form ();
 			f.ShowInTaskbar = false;
 			f.Controls.Add (ts);
 			f.Show ();
+
+			Assert.AreEqual (ts.Items[0], ts.GetNextItem (null, ArrowDirection.Right), "A1");
+			Assert.AreEqual (ts.Items[0], ts.GetNextItem (ts.Items[0], ArrowDirection.Right), "A2");
+
+			ts.Items.Add ("Test Item 2");
 			
-			Assert.AreEqual (ts.Items[0], ts.GetNextItem (null, ArrowDirection.Right), "A5");
-			Assert.AreEqual (ts.Items[1], ts.GetNextItem (ts.Items[0], ArrowDirection.Right), "A6");
-			
+			Assert.AreEqual (ts.Items[0], ts.GetNextItem (null, ArrowDirection.Right), "A3");
+			Assert.AreEqual (ts.Items[1], ts.GetNextItem (ts.Items[0], ArrowDirection.Right), "A4");
+
 			f.Dispose ();
 		}