Author: jpobst
Date: 2007-07-18 17:13:23 -0400 (Wed, 18 Jul 2007)
New Revision: 82243
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBoxTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MenuStripTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripComboBoxTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripContentPanelTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripControlHostTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripDropDownTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripProgressBarTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripTest.cs
Log:
2007-07-18 Jonathan Pobst <[EMAIL PROTECTED]>
* ListBoxTest.cs, MenuStripTest.cs, ToolStripComboBoxTest.cs,
ToolStripContentPanelTest.cs, ToolStripControlHostTest.cs,
ToolStripDropDownTest.cs, ToolStripProgressBarTest.cs,
ToolStripTest.cs: Sync up some local test additions.
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2007-07-18 21:02:40 UTC (rev 82242)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2007-07-18 21:13:23 UTC (rev 82243)
@@ -1,5 +1,12 @@
2007-07-18 Jonathan Pobst <[EMAIL PROTECTED]>
+ * ListBoxTest.cs, MenuStripTest.cs, ToolStripComboBoxTest.cs,
+ ToolStripContentPanelTest.cs, ToolStripControlHostTest.cs,
+ ToolStripDropDownTest.cs, ToolStripProgressBarTest.cs,
+ ToolStripTest.cs: Sync up some local test additions.
+
+2007-07-18 Jonathan Pobst <[EMAIL PROTECTED]>
+
* ListControl.cs: Fix test that is failing on i586.
2007-07-17 Jonathan Pobst <[EMAIL PROTECTED]>
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-07-18 21:02:40 UTC (rev 82242)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBoxTest.cs
2007-07-18 21:13:23 UTC (rev 82243)
@@ -362,6 +362,41 @@
}
}
+#if NET_2_0
+ [Test]
+ public void GetScaledBoundsTest ()
+ {
+ ScaleListBox c = new ScaleListBox ();
+
+ Rectangle r = new Rectangle (100, 200, 300, 400);
+
+ Assert.AreEqual (new Rectangle (200, 100, 596, 50),
c.PublicGetScaledBounds (r, new SizeF (2f, .5f), BoundsSpecified.All), "A1");
+ Assert.AreEqual (new Rectangle (200, 100, 300, 96),
c.PublicGetScaledBounds (r, new SizeF (2f, .5f), BoundsSpecified.Location),
"A2");
+ Assert.AreEqual (new Rectangle (100, 200, 596, 50),
c.PublicGetScaledBounds (r, new SizeF (2f, .5f), BoundsSpecified.Size), "A3");
+ Assert.AreEqual (new Rectangle (100, 200, 300, 50),
c.PublicGetScaledBounds (r, new SizeF (2f, .5f), BoundsSpecified.Height), "A4");
+ Assert.AreEqual (new Rectangle (200, 200, 300, 96),
c.PublicGetScaledBounds (r, new SizeF (2f, .5f), BoundsSpecified.X), "A5");
+ Assert.AreEqual (new Rectangle (100, 200, 300, 96),
c.PublicGetScaledBounds (r, new SizeF (2f, .5f), BoundsSpecified.None), "A6");
+
+ Assert.AreEqual (new Rectangle (100, 200, 300, 96),
c.PublicGetScaledBounds (r, new SizeF (1f, 1f), BoundsSpecified.All), "A6-2");
+ Assert.AreEqual (new Rectangle (200, 400, 596, 188),
c.PublicGetScaledBounds (r, new SizeF (2f, 2f), BoundsSpecified.All), "A7");
+ Assert.AreEqual (new Rectangle (300, 600, 892, 280),
c.PublicGetScaledBounds (r, new SizeF (3f, 3f), BoundsSpecified.All), "A8");
+ Assert.AreEqual (new Rectangle (400, 800, 1188, 372),
c.PublicGetScaledBounds (r, new SizeF (4f, 4f), BoundsSpecified.All), "A9");
+ Assert.AreEqual (new Rectangle (50, 100, 152, 50),
c.PublicGetScaledBounds (r, new SizeF (.5f, .5f), BoundsSpecified.All), "A10");
+ }
+
+ private class ScaleListBox : ListBox
+ {
+ public Rectangle PublicGetScaledBounds (Rectangle
bounds, SizeF factor, BoundsSpecified specified)
+ {
+ return base.GetScaledBounds (bounds, factor,
specified);
+ }
+
+ public void PublicScaleControl (SizeF factor,
BoundsSpecified specified)
+ {
+ base.ScaleControl (factor, specified);
+ }
+ }
+#endif
//
// Events
//
Modified:
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-07-18 21:02:40 UTC (rev 82242)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MenuStripTest.cs
2007-07-18 21:13:23 UTC (rev 82243)
@@ -51,6 +51,8 @@
Assert.AreEqual (false, ms.ShowItemToolTips, "A4");
Assert.AreEqual (true, ms.Stretch, "A5");
Assert.AreEqual
(ToolStripLayoutStyle.HorizontalStackWithOverflow, ms.LayoutStyle, "A6");
+
+ Assert.AreEqual
("System.Windows.Forms.MenuStrip+MenuStripAccessibleObject",
ms.AccessibilityObject.GetType ().ToString (), "A7");
}
[Test]
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripComboBoxTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripComboBoxTest.cs
2007-07-18 21:02:40 UTC (rev 82242)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripComboBoxTest.cs
2007-07-18 21:13:23 UTC (rev 82243)
@@ -103,7 +103,6 @@
//}
[Test]
- [Ignore ("Need DropDownHeight implemented in 2.0 ComboBox")]
public void PropertyDropDownHeight ()
{
ToolStripComboBox tsi = new ToolStripComboBox ();
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripContentPanelTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripContentPanelTest.cs
2007-07-18 21:02:40 UTC (rev 82242)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripContentPanelTest.cs
2007-07-18 21:13:23 UTC (rev 82243)
@@ -44,8 +44,8 @@
ToolStripContentPanel tsp = new ToolStripContentPanel
();
Assert.AreEqual (SystemColors.Control, tsp.BackColor,
"A1");
- //Assert.AreEqual
("System.Windows.Forms.ToolStripSystemRenderer", tsp.Renderer.ToString (),
"A2");
- //Assert.AreEqual (ToolStripRenderMode.System,
tsp.RenderMode, "A3");
+ Assert.AreEqual
("System.Windows.Forms.ToolStripSystemRenderer", tsp.Renderer.ToString (),
"A2");
+ Assert.AreEqual (ToolStripRenderMode.System,
tsp.RenderMode, "A3");
}
[Test]
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripControlHostTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripControlHostTest.cs
2007-07-18 21:02:40 UTC (rev 82242)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripControlHostTest.cs
2007-07-18 21:13:23 UTC (rev 82243)
@@ -56,7 +56,7 @@
Assert.AreEqual (false, tsi.Focused, "A9");
Assert.AreEqual (t.Font, tsi.Font, "A10");
Assert.AreEqual (SystemColors.ControlText,
tsi.ForeColor, "A11");
- //Assert.AreEqual (RightToLeft.No, tsi.RightToLeft,
"A12");
+ Assert.AreEqual (RightToLeft.No, tsi.RightToLeft,
"A12");
Assert.AreEqual (false, tsi.Selected, "A13");
Assert.AreEqual (null, tsi.Site, "A14");
Assert.AreEqual (new Size (0, 0), tsi.Size, "A15");
@@ -230,20 +230,20 @@
Assert.AreEqual (SystemColors.WindowText,
tsi.ForeColor, "B5");
}
- //[Test]
- //public void PropertyRightToLeft ()
- //{
- // ToolStripControlHost tsi = new ToolStripControlHost
(new Control ());
- // EventWatcher ew = new EventWatcher (tsi);
+ [Test]
+ public void PropertyRightToLeft ()
+ {
+ ToolStripControlHost tsi = new ToolStripControlHost
(new Control ());
+ EventWatcher ew = new EventWatcher (tsi);
- // tsi.RightToLeft = RightToLeft.Yes;
- // Assert.AreEqual (RightToLeft.Yes, tsi.RightToLeft,
"B1");
- // Assert.AreEqual (string.Empty, ew.ToString (), "B2");
+ tsi.RightToLeft = RightToLeft.Yes;
+ Assert.AreEqual (RightToLeft.Yes, tsi.RightToLeft,
"B1");
+ Assert.AreEqual (string.Empty, ew.ToString (), "B2");
- // ew.Clear ();
- // tsi.RightToLeft = RightToLeft.Yes;
- // Assert.AreEqual (string.Empty, ew.ToString (), "B3");
- //}
+ ew.Clear ();
+ tsi.RightToLeft = RightToLeft.Yes;
+ Assert.AreEqual (string.Empty, ew.ToString (), "B3");
+ }
[Test]
public void PropertySite ()
@@ -469,4 +469,4 @@
}
}
}
-#endif
\ No newline at end of file
+#endif
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripDropDownTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripDropDownTest.cs
2007-07-18 21:02:40 UTC (rev 82242)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripDropDownTest.cs
2007-07-18 21:13:23 UTC (rev 82243)
@@ -138,7 +138,7 @@
public new DockStyle DefaultDock { get { return
base.DefaultDock; } }
public new Padding DefaultPadding { get { return
base.DefaultPadding; } }
public new bool DefaultShowItemToolTips { get { return
base.DefaultShowItemToolTips; } }
- //public new Size MaxItemSize { get { return
base.MaxItemSize; } }
+ public new Size MaxItemSize { get { return
base.MaxItemSize; } }
public new bool TopMost { get { return base.TopMost; } }
public LayoutSettings PublicCreateLayoutSettings
(ToolStripLayoutStyle style) { return base.CreateLayoutSettings (style); }
}
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripProgressBarTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripProgressBarTest.cs
2007-07-18 21:02:40 UTC (rev 82242)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripProgressBarTest.cs
2007-07-18 21:13:23 UTC (rev 82243)
@@ -48,7 +48,7 @@
Assert.AreEqual (100, tsi.Maximum, "A2");
Assert.AreEqual (0, tsi.Minimum, "A3");
Assert.AreEqual ("System.Windows.Forms.ProgressBar",
tsi.ProgressBar.GetType ().ToString (), "A4");
- //Assert.AreEqual (false, tsi.RightToLeftLayout, "A5");
+ Assert.AreEqual (false, tsi.RightToLeftLayout, "A5");
Assert.AreEqual (10, tsi.Step, "A6");
Assert.AreEqual (ProgressBarStyle.Blocks, tsi.Style,
"A7");
Assert.AreEqual (string.Empty, tsi.Text, "A8");
@@ -113,20 +113,20 @@
Assert.AreEqual (string.Empty, ew.ToString (), "B3");
}
- //[Test]
- //public void PropertyRightToLeft ()
- //{
- // ToolStripProgressBar tsi = new ToolStripProgressBar
();
- // EventWatcher ew = new EventWatcher (tsi);
+ [Test]
+ public void PropertyRightToLeft ()
+ {
+ ToolStripProgressBar tsi = new ToolStripProgressBar ();
+ EventWatcher ew = new EventWatcher (tsi);
- // tsi.RightToLeftLayout = true;
- // Assert.AreEqual (true, tsi.RightToLeftLayout, "B1");
- // Assert.AreEqual ("RightToLeftLayoutChanged",
ew.ToString (), "B2");
+ tsi.RightToLeftLayout = true;
+ Assert.AreEqual (true, tsi.RightToLeftLayout, "B1");
+ Assert.AreEqual ("RightToLeftLayoutChanged",
ew.ToString (), "B2");
- // ew.Clear ();
- // tsi.RightToLeftLayout = true;
- // Assert.AreEqual (string.Empty, ew.ToString (), "B3");
- //}
+ ew.Clear ();
+ tsi.RightToLeftLayout = true;
+ Assert.AreEqual (string.Empty, ew.ToString (), "B3");
+ }
[Test]
@@ -299,7 +299,7 @@
public EventWatcher (ToolStripProgressBar tsi)
{
- //tsi.RightToLeftLayoutChanged += new
EventHandler (delegate (Object obj, EventArgs e) { events +=
("RightToLeftLayoutChanged;"); });
+ tsi.RightToLeftLayoutChanged += new
EventHandler (delegate (Object obj, EventArgs e) { events +=
("RightToLeftLayoutChanged;"); });
}
public override string ToString ()
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-07-18 21:02:40 UTC (rev 82242)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripTest.cs
2007-07-18 21:13:23 UTC (rev 82243)
@@ -48,15 +48,16 @@
Assert.AreEqual (false, ts.AllowDrop, "A1");
//Assert.AreEqual (false, ts.AllowItemReorder, "A2");
- //Assert.AreEqual (true, ts.AllowMerge, "A3");
+ Assert.AreEqual (true, ts.AllowMerge, "A3");
Assert.AreEqual (AnchorStyles.Top | AnchorStyles.Left,
ts.Anchor, "A4");
Assert.AreEqual (true, ts.AutoSize, "A5");
Assert.AreEqual (SystemColors.Control, ts.BackColor,
"A6");
Assert.AreEqual (null, ts.BindingContext, "A7");
- //Assert.AreEqual (true, ts.CanOverflow, "A8");
+ Assert.AreEqual (false, ts.CanSelect, "A7-1");
+ Assert.AreEqual (true, ts.CanOverflow, "A8");
Assert.AreEqual (false, ts.CausesValidation, "A9");
Assert.AreEqual (Cursors.Default, ts.Cursor, "A10");
- //Assert.AreEqual
(ToolStripDropDownDirection.BelowRight, ts.DefaultDropDownDirection, "A11");
+ Assert.AreEqual (ToolStripDropDownDirection.BelowRight,
ts.DefaultDropDownDirection, "A11");
Assert.AreEqual (new Rectangle (7, 0, 92, 25),
ts.DisplayRectangle, "A12");
Assert.AreEqual (DockStyle.Top, ts.Dock, "A13");
Assert.AreEqual (new Font ("Tahoma", 8.25f), ts.Font,
"A14");
@@ -74,13 +75,13 @@
Assert.AreEqual (null, ts.LayoutSettings, "A26");
Assert.AreEqual
(ToolStripLayoutStyle.HorizontalStackWithOverflow, ts.LayoutStyle, "A27");
Assert.AreEqual (Orientation.Horizontal,
ts.Orientation, "A28");
- //Assert.AreEqual
("System.Windows.Forms.ToolStripOverflowButton", ts.OverflowButton.ToString (),
"A29");
+ Assert.AreEqual
("System.Windows.Forms.ToolStripOverflowButton", ts.OverflowButton.GetType
().ToString (), "A29");
Assert.AreEqual
("System.Windows.Forms.ToolStripProfessionalRenderer", ts.Renderer.ToString (),
"A30");
Assert.AreEqual (ToolStripRenderMode.ManagerRenderMode,
ts.RenderMode, "A31");
Assert.AreEqual (true, ts.ShowItemToolTips, "A32");
Assert.AreEqual (false, ts.Stretch, "A33");
Assert.AreEqual (false, ts.TabStop, "A34");
- //Assert.AreEqual (ToolStripTextDirection.Horizontal,
ts.TextDirection, "A35");
+ Assert.AreEqual (ToolStripTextDirection.Horizontal,
ts.TextDirection, "A35");
ts = new ToolStrip (new ToolStripButton (), new
ToolStripSeparator (), new ToolStripButton ());
Assert.AreEqual (3, ts.Items.Count, "A36");
@@ -123,7 +124,13 @@
Assert.AreEqual (new Padding (0,0,1,0),
epp.DefaultPadding, "C4");
Assert.AreEqual (true, epp.DefaultShowItemToolTips,
"C5");
Assert.AreEqual (new Size (100, 25), epp.DefaultSize,
"C6");
- //Assert.AreEqual (new Size (92, 25), epp.MaxItemSize,
"C7");
+ Assert.AreEqual (new Size (92, 25), epp.MaxItemSize,
"C7");
+
+ epp.Size = new Size (300, 100);
+ Assert.AreEqual (new Size (292, 100), epp.MaxItemSize,
"C8");
+
+ epp.GripStyle = ToolStripGripStyle.Hidden;
+ Assert.AreEqual (new Size (299, 100), epp.MaxItemSize,
"C9");
}
[Test]
@@ -170,16 +177,16 @@
// ts.AllowDrop = true;
//}
- //[Test]
- //public void PropertyAllowMerge ()
- //{
- // ToolStrip ts = new ToolStrip ();
- // EventWatcher ew = new EventWatcher (ts);
+ [Test]
+ public void PropertyAllowMerge ()
+ {
+ ToolStrip ts = new ToolStrip ();
+ EventWatcher ew = new EventWatcher (ts);
- // ts.AllowMerge = false;
- // Assert.AreEqual (false, ts.AllowMerge, "B1");
- // Assert.AreEqual (string.Empty, ew.ToString (), "B2");
- //}
+ ts.AllowMerge = false;
+ Assert.AreEqual (false, ts.AllowMerge, "B1");
+ Assert.AreEqual (string.Empty, ew.ToString (), "B2");
+ }
[Test]
public void PropertyAnchorAndDocking ()
@@ -543,15 +550,15 @@
// Assert.AreEqual ("LayoutCompleted", ew.ToString (),
"B3");
//}
- //[Test]
- //[ExpectedException (typeof (InvalidEnumArgumentException))]
- //public void PropertyTextDirectionIEAE ()
- //{
- // ToolStrip ts = new ToolStrip ();
- // EventWatcher ew = new EventWatcher (ts);
+ [Test]
+ [ExpectedException (typeof (InvalidEnumArgumentException))]
+ public void PropertyTextDirectionIEAE ()
+ {
+ ToolStrip ts = new ToolStrip ();
+ EventWatcher ew = new EventWatcher (ts);
- // ts.TextDirection = (ToolStripTextDirection) 42;
- //}
+ ts.TextDirection = (ToolStripTextDirection)42;
+ }
[Test]
[NUnit.Framework.Category ("NotWorking")]
@@ -667,6 +674,24 @@
}
[Test]
+ public void MethodResetMinimumSize ()
+ {
+ ToolStrip ts = new ToolStrip ();
+ ts.Size = new Size (600, 600);
+
+ Assert.AreEqual (new Size (0, 0), ts.MinimumSize, "M0");
+
+ ts.MinimumSize = new Size (400, 400);
+
+ Assert.AreEqual (new Size (600, 600), ts.Size, "M1");
+ Assert.AreEqual (new Size (400, 400), ts.MinimumSize,
"M2");
+
+ ts.ResetMinimumSize ();
+ Assert.AreEqual (new Size (600, 600), ts.Size, "M3");
+ Assert.AreEqual (new Size (-1, -1), ts.MinimumSize,
"M4");
+ }
+
+ [Test]
public void TestToolStrip ()
{
ToolStrip ts = new ToolStrip ();
@@ -777,7 +802,7 @@
public new Padding DefaultPadding { get { return
base.DefaultPadding; } }
public new bool DefaultShowItemToolTips { get { return
base.DefaultShowItemToolTips; } }
public new Size DefaultSize { get { return
base.DefaultSize; } }
- //public new Size MaxItemSize { get { return
base.MaxItemSize; } }
+ public new Size MaxItemSize { get { return
base.MaxItemSize; } }
public ControlStyles GetControlStyles ()
{
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches