diff options
author | Everaldo Canuto <everaldo@mono-cvs.ximian.com> | 2007-01-24 04:37:52 +0300 |
---|---|---|
committer | Everaldo Canuto <everaldo@mono-cvs.ximian.com> | 2007-01-24 04:37:52 +0300 |
commit | 70341b74f6aca81cebcbccd543f95b295a68ffbf (patch) | |
tree | f912cbc157e92d72d67b99d7b28d35a823958003 | |
parent | bbc71a7d82e8090e002a355afb8007d54274041a (diff) |
2007-01-23 Everaldo Canuto <everaldo@simios.org>
* ToobarTest.cs: TooBar.ButtonSize tests added.
svn path=/trunk/mcs/; revision=71575
-rw-r--r-- | mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolBarTest.cs | 27 |
2 files changed, 31 insertions, 0 deletions
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog index fde96055ffa..7d116e5fd45 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog @@ -1,3 +1,7 @@ +2007-01-23 Everaldo Canuto <everaldo@simios.org> + + * ToobarTest.cs: TooBar.ButtonSize tests added. + 2007-01-23 Jonathan Pobst <monkey@jpobst.com> * GridTableStylesCollectionTest.cs: Mark TestAdd as NotWorking. diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolBarTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolBarTest.cs index 4e6f88766a9..c993367068d 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolBarTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolBarTest.cs @@ -140,6 +140,33 @@ namespace MonoTests.System.Windows.Forms Assert.AreEqual (DockStyle.Top, toolBar.Dock, "#1"); Assert.AreEqual (form.ClientSize.Width, toolBar.Width, "#2"); } + + [Test] + public void ButtonSizeTest () + { + Form form = new Form (); + form.ShowInTaskbar = false; + + ToolBar toolBar = new ToolBar (); + + // Size is fixed when dont have buttons + Assert.AreEqual (39, toolBar.ButtonSize.Width, "#1"); + Assert.AreEqual (36, toolBar.ButtonSize.Height, "#2"); + + toolBar.Buttons.Add (new ToolBarButton ("")); + form.Controls.Add (toolBar); + form.Show (); + + // We cannot determine exact size as it depends of font size + Assert.IsTrue (toolBar.ButtonSize.Width < 39, "#3"); + Assert.IsTrue (toolBar.ButtonSize.Height < 36, "#4"); + + toolBar.Buttons.Add (new ToolBarButton ("Teste")); + + // We cannot determine exact size as it depends of font size + Assert.IsTrue (toolBar.ButtonSize.Width >= 39, "#5"); + Assert.IsTrue (toolBar.ButtonSize.Height >= 36, "#6"); + } } // [MonoTODO ("Add test for ButtonClickEvent (Visual Test)"] |