Author: jpobst
Date: 2007-01-16 12:22:15 -0500 (Tue, 16 Jan 2007)
New Revision: 71156
Added:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlCollectionTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MenuStripTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripMenuItemTest.cs
Modified:
trunk/mcs/class/Managed.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms_test.dll.sources
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlPropertyEventsTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/EventArgsTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FlowPanelTests.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/SplitContainerTests.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripTest.cs
Log:
2007-01-16 Jonathan Pobst <[EMAIL PROTECTED]>
* ControlPropertyEventsTest.cs: Enable PropertyMinimumSize test.
* ControlTest.cs: Move ControlCollection tests to
ControlCollectionTest.cs.
* EventArgsTest.cs, FlowPanelTests.cs: Change namespace to match all
other tests.
* FormTest.cs: Add tests for FormClosed event and Show (IWin32Window).
* MenuStripTest.cs: Add test for MDI.
* SplitContainerTest.cs: Change namespace, remove
TestNotRelaventProperties.
* ToolStripMenuItemTest.cs: Add test for MDI.
* ToolStripTest.cs: Ignore ControlStyle, Un-Ignore PropertyAutoSize.
Modified: trunk/mcs/class/Managed.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/ChangeLog 2007-01-16 17:19:22 UTC
(rev 71155)
+++ trunk/mcs/class/Managed.Windows.Forms/ChangeLog 2007-01-16 17:22:15 UTC
(rev 71156)
@@ -1,3 +1,8 @@
+2007-01-16 Jonathan Pobst <[EMAIL PROTECTED]>
+
+ * System.Windows.Forms_test.dll: Add ControlCollectionTest.cs,
+ MenuStripTest.cs, ToolStripMenuItemTest.cs.
+
2007-01-04 Jonathan Pobst <[EMAIL PROTECTED]>
* System.Windows.Forms_test.dll: Add ControlPropertyEventsTest.cs.
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms_test.dll.sources
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms_test.dll.sources
2007-01-16 17:19:22 UTC (rev 71155)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms_test.dll.sources
2007-01-16 17:22:15 UTC (rev 71156)
@@ -18,6 +18,7 @@
System.Windows.Forms/CommonDialogsTest.cs
System.Windows.Forms/ContainerControlTest.cs
System.Windows.Forms/ControlBindingsConverterTest.cs
+System.Windows.Forms/ControlCollectionTest.cs
System.Windows.Forms/ControlEventTest.cs
System.Windows.Forms/ControlTest.cs
System.Windows.Forms/ControlPaintTest.cs
@@ -59,6 +60,7 @@
System.Windows.Forms/ListViewItemTest.cs
System.Windows.Forms/MdiFormTest.cs
System.Windows.Forms/MessageTest.cs
+System.Windows.Forms/MenuStripTest.cs
System.Windows.Forms/MenuTest.cs
System.Windows.Forms/MenuItemTest.cs
System.Windows.Forms/MonthCalendarTest.cs
@@ -89,6 +91,7 @@
System.Windows.Forms/ToolStripControlHostTest.cs
System.Windows.Forms/ToolStripItemTest.cs
System.Windows.Forms/ToolStripLabelTest.cs
+System.Windows.Forms/ToolStripMenuItemTest.cs
System.Windows.Forms/ToolStripProgressBarTest.cs
System.Windows.Forms/ToolStripSeparatorTest.cs
System.Windows.Forms/ToolStripTest.cs
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2007-01-16 17:19:22 UTC (rev 71155)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2007-01-16 17:22:15 UTC (rev 71156)
@@ -1,3 +1,21 @@
+2007-01-16 Jonathan Pobst <[EMAIL PROTECTED]>
+
+ * ControlPropertyEventsTest.cs: Enable PropertyMinimumSize test.
+
+ * ControlTest.cs: Move ControlCollection tests to
ControlCollectionTest.cs.
+
+ * EventArgsTest.cs, FlowPanelTests.cs: Change namespace to match all
other tests.
+
+ * FormTest.cs: Add tests for FormClosed event and Show (IWin32Window).
+
+ * MenuStripTest.cs: Add test for MDI.
+
+ * SplitContainerTest.cs: Change namespace, remove
TestNotRelaventProperties.
+
+ * ToolStripMenuItemTest.cs: Add test for MDI.
+
+ * ToolStripTest.cs: Ignore ControlStyle, Un-Ignore PropertyAutoSize.
+
2007-01-16 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
* MdiFormTest.cs: Added tests for ActiveChild for mdi parents.
Added:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlCollectionTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlCollectionTest.cs
2007-01-16 17:19:22 UTC (rev 71155)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlCollectionTest.cs
2007-01-16 17:22:15 UTC (rev 71156)
@@ -0,0 +1,79 @@
+#if NET_2_0
+using System;
+using System.Collections.Generic;
+using System.Text;
+using NUnit.Framework;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace MonoTests.System.Windows.Forms
+{
+ [TestFixture]
+ public class ControlCollectionTest
+ {
+ [Test]
+ public void ControlCollectionTests ()
+ {
+ Control c = new Control ();
+ c.Name = "A";
+ Control c2 = new Control ();
+ c2.Name = "B";
+ Control c3 = new Control ();
+ c3.Name = "a";
+ Control c4 = new Control ();
+ c4.Name = "B";
+ Control c5 = new Control ();
+ c5.Name = "a";
+
+ c.Controls.Add (c2);
+ c.Controls.Add (c3);
+ c2.Controls.Add (c4);
+ c2.Controls.Add (c5);
+
+ // this[key]
+ Assert.AreSame (c2, c.Controls["B"], "A1");
+ Assert.AreSame (c2, c.Controls["b"], "A2");
+
+ // Owner
+ Assert.AreSame (c, c.Controls.Owner, "A3");
+
+ // ContainsKey
+ Assert.AreEqual (true, c.Controls.ContainsKey ("A"),
"A4");
+ Assert.AreEqual (true, c.Controls.ContainsKey ("a"),
"A5");
+ Assert.AreEqual (false, c.Controls.ContainsKey ("C"),
"A6");
+
+ // Find
+ Assert.AreEqual (1, c.Controls.Find ("A",
false).Length, "A7");
+ Assert.AreEqual (1, c.Controls.Find ("a",
false).Length, "A8");
+ Assert.AreEqual (0, c.Controls.Find ("C",
false).Length, "A9");
+
+ Assert.AreEqual (2, c.Controls.Find ("A", true).Length,
"A10");
+ Assert.AreEqual (2, c.Controls.Find ("a", true).Length,
"A11");
+ Assert.AreEqual (0, c.Controls.Find ("C", true).Length,
"A12");
+ Assert.AreEqual (1, c2.Controls.Find ("b",
true).Length, "A13");
+
+ // IndexOfKey
+ Assert.AreEqual (1, c.Controls.IndexOfKey ("A"), "A14");
+ Assert.AreEqual (1, c.Controls.IndexOfKey ("a"), "A15");
+ Assert.AreEqual (-1, c.Controls.IndexOfKey ("C"),
"A16");
+
+ // RemoveByKey
+ c.Controls.RemoveByKey ("A");
+ Assert.AreEqual (1, c.Controls.Count, "A17");
+
+ c.Controls.RemoveByKey ("b");
+ Assert.AreEqual (0, c.Controls.Count, "A18");
+
+ c.Controls.RemoveByKey (null);
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentNullException))]
+ public void ControlCollectionFindANE ()
+ {
+ Control c = new Control ();
+ c.Controls.Find ("", false);
+ }
+ }
+}
+#endif
\ No newline at end of file
Property changes on:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlCollectionTest.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlPropertyEventsTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlPropertyEventsTest.cs
2007-01-16 17:19:22 UTC (rev 71155)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlPropertyEventsTest.cs
2007-01-16 17:22:15 UTC (rev 71156)
@@ -378,7 +378,6 @@
}
[Test]
- [Ignore ("Resize events do not fire because MinimumSize is not
considered in the PerformLayout yet")]
public void PropertyMinimumSize ()
{
Control c = new Control ();
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs
2007-01-16 17:19:22 UTC (rev 71155)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs
2007-01-16 17:22:15 UTC (rev 71156)
@@ -1906,73 +1906,5 @@
private bool _layoutInvoked;
}
}
-
- [TestFixture]
- public class ControlCollectionTest
- {
- [Test]
- public void ControlCollectionTests ()
- {
- Control c = new Control ();
- c.Name = "A";
- Control c2 = new Control ();
- c2.Name = "B";
- Control c3 = new Control ();
- c3.Name = "a";
- Control c4 = new Control ();
- c4.Name = "B";
- Control c5 = new Control ();
- c5.Name = "a";
-
- c.Controls.Add (c2);
- c.Controls.Add (c3);
- c2.Controls.Add (c4);
- c2.Controls.Add (c5);
-
- // this[key]
- Assert.AreSame (c2, c.Controls["B"], "A1");
- Assert.AreSame (c2, c.Controls["b"], "A2");
-
- // Owner
- Assert.AreSame (c, c.Controls.Owner, "A3");
-
- // ContainsKey
- Assert.AreEqual (true, c.Controls.ContainsKey ("A"),
"A4");
- Assert.AreEqual (true, c.Controls.ContainsKey ("a"),
"A5");
- Assert.AreEqual (false, c.Controls.ContainsKey ("C"),
"A6");
-
- // Find
- Assert.AreEqual (1, c.Controls.Find ("A",
false).Length, "A7");
- Assert.AreEqual (1, c.Controls.Find ("a",
false).Length, "A8");
- Assert.AreEqual (0, c.Controls.Find ("C",
false).Length, "A9");
-
- Assert.AreEqual (2, c.Controls.Find ("A", true).Length,
"A10");
- Assert.AreEqual (2, c.Controls.Find ("a", true).Length,
"A11");
- Assert.AreEqual (0, c.Controls.Find ("C", true).Length,
"A12");
- Assert.AreEqual (1, c2.Controls.Find ("b",
true).Length, "A13");
-
- // IndexOfKey
- Assert.AreEqual (1, c.Controls.IndexOfKey ("A"), "A14");
- Assert.AreEqual (1, c.Controls.IndexOfKey ("a"), "A15");
- Assert.AreEqual (-1, c.Controls.IndexOfKey ("C"),
"A16");
-
- // RemoveByKey
- c.Controls.RemoveByKey ("A");
- Assert.AreEqual (1, c.Controls.Count, "A17");
-
- c.Controls.RemoveByKey ("b");
- Assert.AreEqual (0, c.Controls.Count, "A18");
-
- c.Controls.RemoveByKey (null);
- }
-
- [Test]
- [ExpectedException (typeof (ArgumentNullException))]
- public void ControlCollectionFindANE ()
- {
- Control c = new Control ();
- c.Controls.Find ("", false);
- }
- }
#endif
}
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/EventArgsTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/EventArgsTest.cs
2007-01-16 17:19:22 UTC (rev 71155)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/EventArgsTest.cs
2007-01-16 17:22:15 UTC (rev 71156)
@@ -7,7 +7,7 @@
using System.ComponentModel;
using System.Drawing;
-namespace MonoTestSuite
+namespace MonoTests.System.Windows.Forms
{
[TestFixture]
public class EventArgsTest
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FlowPanelTests.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FlowPanelTests.cs
2007-01-16 17:19:22 UTC (rev 71155)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FlowPanelTests.cs
2007-01-16 17:22:15 UTC (rev 71156)
@@ -1,3 +1,4 @@
+#if NET_2_0
using System;
using System.Text;
using NUnit.Framework;
@@ -3,8 +4,7 @@
using System.Windows.Forms;
using System.Drawing;
+using System.Collections.Generic;
-#if NET_2_0
-using System.Collections.Generic;
-namespace ProfessionalColorTest
+namespace MonoTests.System.Windows.Forms
{
[TestFixture()]
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs
2007-01-16 17:19:22 UTC (rev 71155)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs
2007-01-16 17:22:15 UTC (rev 71156)
@@ -547,6 +547,59 @@
Assert.AreEqual ("Closing;FormClosing
[Reason:UserClosing - Cancel:True]", events, "A1");
}
+
+ [Test]
+ public void FormClosedEvents ()
+ {
+ // Standard Closed
+ Form f = new Form ();
+ string events = string.Empty;
+
+ f.Closed += new EventHandler (delegate (Object obj,
EventArgs e) { events += ("Closed;"); });
+ f.FormClosed += new FormClosedEventHandler (delegate
(Object obj, FormClosedEventArgs e) { events += string.Format ("FormClosed
[Reason:{0}]", e.CloseReason); });
+
+ f.Show ();
+ f.Close ();
+
+ Assert.AreEqual ("Closed;FormClosed
[Reason:UserClosing]", events, "A1");
+ }
+
+ [Test]
+ public void ShowWithOwner ()
+ {
+ Form f = new Form ();
+ Button b = new Button ();
+ f.Controls.Add (b);
+
+ Form f2 = new Form ();
+
+ f2.Show (f);
+
+ Assert.AreSame (f, f2.Owner, "A1");
+
+ f2 = new Form ();
+
+ f2.Show (b);
+ Assert.AreSame (f, f2.Owner, "A2");
+
+ Button b2 = new Button ();
+ f2 = new Form ();
+
+ f2.Show (b2);
+ Assert.AreEqual (null, f2.Owner, "A3");
+
+ f2 = new Form ();
+ f2.Show (null);
+ Assert.AreEqual (null, f2.Owner, "A4");
+ }
+
+ [Test]
+ [ExpectedException (typeof (InvalidOperationException))]
+ public void ShowWithOwnerIOE ()
+ {
+ Form f = new Form ();
+ f.Show (f);
+ }
#endif
private bool RunningOnUnix {
Added:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MenuStripTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MenuStripTest.cs
2007-01-16 17:19:22 UTC (rev 71155)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MenuStripTest.cs
2007-01-16 17:22:15 UTC (rev 71156)
@@ -0,0 +1,97 @@
+//
+// MenuStripTest.cs
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2006 Jonathan Pobst
+//
+// Authors:
+// Jonathan Pobst ([EMAIL PROTECTED])
+//
+#if NET_2_0
+using System;
+using System.Collections.Generic;
+using System.Text;
+using NUnit.Framework;
+using System.Drawing;
+using System.Windows.Forms;
+using System.ComponentModel;
+
+namespace MonoTests.System.Windows.Forms
+{
+ [TestFixture]
+ public class MenuStripTest
+ {
+ [Test]
+ public void BehaviorMdiWindowMenuItem ()
+ {
+ Form f = new Form ();
+ f.IsMdiContainer = true;
+ Form c1 = new Form ();
+ c1.MdiParent = f;
+ Form c2 = new Form ();
+ c2.MdiParent = f;
+
+ MenuStrip ms = new MenuStrip ();
+ ToolStripMenuItem tsmi =
(ToolStripMenuItem)ms.Items.Add ("Window");
+ f.Controls.Add (ms);
+ ms.MdiWindowListItem = tsmi;
+
+ Assert.AreSame (tsmi, ms.MdiWindowListItem, "Q1");
+ Assert.AreEqual (0, tsmi.DropDownItems.Count, "Q2");
+
+ f.MainMenuStrip = ms;
+ Assert.AreEqual (0, tsmi.DropDownItems.Count, "Q3");
+
+ c1.Show ();
+ Assert.AreEqual (0, tsmi.DropDownItems.Count, "Q4");
+
+ f.Show ();
+ Assert.AreEqual (1, tsmi.DropDownItems.Count, "Q5");
+ Assert.AreEqual (true, (tsmi.DropDownItems[0] as
ToolStripMenuItem).Checked, "Q6");
+
+ c2.Show ();
+ Assert.AreEqual (2, tsmi.DropDownItems.Count, "Q7");
+ Assert.AreEqual (true, (tsmi.DropDownItems[1] as
ToolStripMenuItem).Checked, "Q8");
+
+ Form c3 = new Form ();
+ c3.MdiParent = f;
+ Assert.AreEqual (2, tsmi.DropDownItems.Count, "Q9");
+
+ c3.Show ();
+ Assert.AreEqual (3, tsmi.DropDownItems.Count, "Q10");
+ Assert.AreEqual (true, (tsmi.DropDownItems[2] as
ToolStripMenuItem).Checked, "Q11");
+
+ c3.Hide ();
+ Assert.AreEqual (2, tsmi.DropDownItems.Count, "Q12");
+ Assert.AreEqual (true, (tsmi.DropDownItems[1] as
ToolStripMenuItem).Checked, "Q13");
+
+ // Technically, adding the Cascade item adds it to the
end of the list until
+ // anything regarding Mdi is clicked, which then moves
it to the top of
+ // the list and adds the separator.
+ // Calling c3.Show() forces the Cascade menu to the top.
+ tsmi.DropDownItems.Add ("Cascade");
+ c3.Show ();
+ Assert.AreEqual (5, tsmi.DropDownItems.Count, "Q14");
+ Assert.AreEqual (true, (tsmi.DropDownItems[4] as
ToolStripMenuItem).Checked, "Q15");
+ }
+ }
+}
+#endif
\ No newline at end of file
Property changes on:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MenuStripTest.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/SplitContainerTests.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/SplitContainerTests.cs
2007-01-16 17:19:22 UTC (rev 71155)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/SplitContainerTests.cs
2007-01-16 17:22:15 UTC (rev 71156)
@@ -4,7 +4,7 @@
using System.Windows.Forms;
using System.Drawing;
-namespace ProfessionalColorTest
+namespace MonoTests.System.Windows.Forms
{
[TestFixture]
public class SplitContainerTests
@@ -31,58 +31,10 @@
}
[Test]
- public void TestNotReleventProperties()
+ public void TestProperties ()
{
- // (MSDN lists are the following as "This property is
not relevant to this class.")
SplitContainer sc = new SplitContainer ();
- Assert.AreEqual (false, sc.AutoScroll, "B1");
- sc.AutoScroll = true;
- Assert.AreEqual (false, sc.AutoScroll, "B1-2");
-
- Assert.AreEqual (new Size(0,0), sc.AutoScrollMargin,
"B2");
- sc.AutoScrollMargin = new Size (100, 100);
- Assert.AreEqual (new Size (100,100),
sc.AutoScrollMargin, "B2-2");
-
- Assert.AreEqual (new Size (0, 0), sc.AutoScrollMinSize,
"B3");
- sc.AutoScrollMinSize = new Size (100, 100);
- Assert.AreEqual (new Size (100, 100),
sc.AutoScrollMinSize, "B3-2");
-
- //Assert.AreEqual (new Point (0, 0),
sc.AutoScrollOffset, "B4");
- //sc.AutoScrollOffset = new Point (100, 100);
- //Assert.AreEqual (new Point (100, 100),
sc.AutoScrollOffset, "B4-2");
-
- Assert.AreEqual (new Point (0, 0),
sc.AutoScrollPosition, "B5");
- sc.AutoScrollPosition = new Point (100, 100);
- Assert.AreEqual (new Point (0, 0),
sc.AutoScrollPosition, "B5-2");
-
- Assert.AreEqual (false, sc.AutoSize, "B6");
- sc.AutoSize = true;
- Assert.AreEqual (true, sc.AutoSize, "B6-2");
-
- //Assert.AreEqual (ImageLayout.Tile,
sc.BackgroundImageLayout, "B7");
- //sc.BackgroundImageLayout = ImageLayout.Stretch;
- //Assert.AreEqual (ImageLayout.Stretch,
sc.BackgroundImageLayout, "B7-2");
-
- Assert.AreEqual (null, sc.BindingContext, "B8");
- sc.BindingContext = new BindingContext();
- Assert.AreEqual ("System.Windows.Forms.BindingContext",
sc.BindingContext.ToString (), "B8-2");
-
- Assert.AreEqual (new Padding(0), sc.Padding, "B10");
- sc.Padding = new Padding (7);
- Assert.AreEqual (new Padding (7), sc.Padding, "B10-2");
-
- Assert.AreEqual (String.Empty, sc.Text, "B11");
- sc.Text = "Hello";
- Assert.AreEqual ("Hello", sc.Text, "B11-2");
-
- }
-
- [Test]
- public void TestRelevantProperties ()
- {
- SplitContainer sc = new SplitContainer ();
-
sc.BorderStyle = BorderStyle.FixedSingle;
Assert.AreEqual (BorderStyle.FixedSingle,
sc.BorderStyle, "C1");
Added:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripMenuItemTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripMenuItemTest.cs
2007-01-16 17:19:22 UTC (rev 71155)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripMenuItemTest.cs
2007-01-16 17:22:15 UTC (rev 71156)
@@ -0,0 +1,65 @@
+//
+// ToolStripMenuItemTest.cs
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2006 Jonathan Pobst
+//
+// Authors:
+// Jonathan Pobst ([EMAIL PROTECTED])
+//
+#if NET_2_0
+using System;
+using System.Collections.Generic;
+using System.Text;
+using NUnit.Framework;
+using System.Drawing;
+using System.Windows.Forms;
+using System.ComponentModel;
+
+namespace MonoTests.System.Windows.Forms
+{
+ [TestFixture]
+ public class ToolStripMenuItemTest
+ {
+ [Test]
+ public void BehaviorMdiWindowMenuItem ()
+ {
+ Form f = new Form ();
+ f.IsMdiContainer = true;
+ Form c1 = new Form ();
+ c1.MdiParent = f;
+ Form c2 = new Form ();
+ c2.MdiParent = f;
+
+ MenuStrip ms = new MenuStrip ();
+ ToolStripMenuItem tsmi =
(ToolStripMenuItem)ms.Items.Add ("Window");
+ f.Controls.Add (ms);
+ ms.MdiWindowListItem = tsmi;
+
+ f.MainMenuStrip = ms;
+
+ c1.Show ();
+ f.Show ();
+ Assert.AreEqual (true, (tsmi.DropDownItems[0] as
ToolStripMenuItem).IsMdiWindowListEntry, "R1");
+ }
+ }
+}
+#endif
\ No newline at end of file
Property changes on:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripMenuItemTest.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripTest.cs
2007-01-16 17:19:22 UTC (rev 71155)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripTest.cs
2007-01-16 17:22:15 UTC (rev 71156)
@@ -85,6 +85,7 @@
}
[Test]
+ [Ignore ("OptimizedDoubleBuffer is disabled due to bug #80447")]
public void ControlStyle ()
{
ExposeProtectedProperties epp = new
ExposeProtectedProperties ();
@@ -207,7 +208,7 @@
}
[Test]
- [Ignore ("Needs Control.AutoSizeChanged to fire")]
+ //[Ignore ("Needs Control.AutoSizeChanged to fire")]
public void PropertyAutoSize ()
{
ToolStrip ts = new ToolStrip ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches