2007-01-25 Rolf Bjarne Kvinge <RKvinge@novell.com>
authorRolf Bjarne Kvinge <RKvinge@novell.com>
Thu, 25 Jan 2007 12:41:01 +0000 (12:41 -0000)
committerRolf Bjarne Kvinge <RKvinge@novell.com>
Thu, 25 Jan 2007 12:41:01 +0000 (12:41 -0000)
* ComboBoxTest.cs: Add tests for new properties.
* MdiFormTest.cs: Set ShowInTaskbar = false for main forms.

svn path=/trunk/mcs/; revision=71662

mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTest.cs
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MdiFormTest.cs

index 4461b669886ffc40650a06d832be930f0703eef9..30339d459631b6618449fbe33c0d81e91d1247af 100644 (file)
@@ -1,3 +1,8 @@
+2007-01-25  Rolf Bjarne Kvinge  <RKvinge@novell.com>
+
+       * ComboBoxTest.cs: Add tests for new properties.
+       * MdiFormTest.cs: Set ShowInTaskbar = false for main forms.
+
 2007-01-24  Gert Driesen  <drieseng@users.sourceforge.net>
 
        * FormTest.cs: Added NotWorking test for bug #80604.
index c1abada6e6ba125528a1598b0a198f359a342f5d..08849795ab5143b95b0d8ab3ed0f5a6e91dd6930 100644 (file)
@@ -68,9 +68,98 @@ namespace MonoTests.System.Windows.Forms
 
                        mycmbbox.AutoCompleteCustomSource = null;
                        Assert.AreEqual (true, mycmbbox.AutoCompleteCustomSource != null, "#21");
+                       
+                       Assert.AreEqual (ImageLayout.Tile, mycmbbox.BackgroundImageLayout, "#22");
+                       Assert.AreEqual (null, mycmbbox.DataSource, "#23");
+                       Assert.AreEqual (106, mycmbbox.DropDownHeight, "#24");
+                       Assert.AreEqual (FlatStyle.Standard, mycmbbox.FlatStyle, "#25");
+                       Assert.AreEqual ("{Width=0, Height=0}", mycmbbox.MaximumSize.ToString (), "#26");
+                       Assert.AreEqual ("{Width=0, Height=0}", mycmbbox.MinimumSize.ToString (), "#27");
+                       Assert.AreEqual ("{Left=0,Top=0,Right=0,Bottom=0}", mycmbbox.Padding.ToString (), "#28");
+                       
 #endif
                }
 
+#if NET_2_0
+               [Test]
+               public void BackgroundImageLayoutTest ()
+               {
+                       ComboBox cmbbox = new ComboBox ();
+                       cmbbox.BackgroundImageLayout = ImageLayout.Stretch;
+                       Assert.AreEqual (ImageLayout.Stretch, cmbbox.BackgroundImageLayout, "#01");
+               }
+               
+               [Test]
+               public void DropDownHeightTest ()
+               {
+                       ComboBox cmbbox = new ComboBox ();
+                       cmbbox.DropDownHeight = 225;
+                       Assert.AreEqual (225, cmbbox.DropDownHeight, "#01");
+                       cmbbox.DropDownHeight = 1;
+                       Assert.AreEqual (1, cmbbox.DropDownHeight, "#02");
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentOutOfRangeException))]
+               public void DropDownHeightExceptionTest1 ()
+               {
+                       ComboBox cmbbox = new ComboBox ();
+                       cmbbox.DropDownHeight = -225;   
+               }
+
+               [Test]
+               [ExpectedException (typeof (ArgumentOutOfRangeException))]
+               public void DropDownHeightExceptionTest2 ()
+               {
+                       ComboBox cmbbox = new ComboBox ();
+                       cmbbox.DropDownHeight = 0;
+               }
+               
+               [Test]
+               public void FlatStyleTest ()
+               {
+                       ComboBox cmbbox = new ComboBox ();
+                       cmbbox.FlatStyle = FlatStyle.Popup;
+                       Assert.AreEqual (FlatStyle.Popup, cmbbox.FlatStyle, "#01");
+               }
+               
+               [Test]
+               [ExpectedException (typeof (InvalidEnumArgumentException))]
+               public void FlatStyleExceptionTest ()
+               {
+                       ComboBox cmbbox = new ComboBox ();
+                       cmbbox.FlatStyle = (FlatStyle) (-123);
+               }
+       
+               [Test]
+               public void MaximumSizeTest ()
+               {
+                       ComboBox cmbbox = new ComboBox ();
+                       cmbbox.MaximumSize = new Size (25, 25);
+                       Assert.AreEqual ("{Width=25, Height=0}", cmbbox.MaximumSize.ToString (), "#01");
+                       cmbbox.MaximumSize = new Size (50, 75);
+                       Assert.AreEqual ("{Width=50, Height=0}", cmbbox.MaximumSize.ToString (), "#02");
+               }
+       
+               [Test]
+               public void MinumumSizeTest ()
+               {
+                       ComboBox cmbbox = new ComboBox ();
+                       cmbbox.MinimumSize = new Size (25, 25);
+                       Assert.AreEqual ("{Width=25, Height=0}", cmbbox.MinimumSize.ToString (), "#1");
+                       cmbbox.MinimumSize = new Size (50, 75);
+                       Assert.AreEqual ("{Width=50, Height=0}", cmbbox.MinimumSize.ToString (), "#2"); 
+               }
+               
+               [Test]
+               public void PaddingTest ()
+               {
+                       ComboBox cmbbox = new ComboBox ();
+                       cmbbox.Padding = new Padding (21);
+                       Assert.AreEqual ("{Left=21,Top=21,Right=21,Bottom=21}", cmbbox.Padding.ToString (), "#01");
+               }
+#endif
+
                [Test]
                public void BeginEndUpdateTest ()
                {
index 79b2c4ee48b7fbc85fdd3cd8208ac6a062fe9f3e..e9a52211996db70601a54c770fc79415674eb48e 100644 (file)
@@ -46,8 +46,8 @@ namespace MonoTests.System.Windows.Forms
                public void SetUp (bool only_create, bool only_text)
                {
                        SetUp (only_create, only_text, false);
-               }
-
+               }       
+                               
                // No attribute here since this is supposed to be called from 
                // each test directly, not by nunit.
                public void SetUp (bool only_create, bool only_text, bool set_parent)
@@ -63,6 +63,7 @@ namespace MonoTests.System.Windows.Forms
                                return;
 
                        main.Text = main.Name = "main";
+                       main.ShowInTaskbar = false;
                        child1.Text = child1.Name = "child1";
                        child2.Text = child2.Name = "child2";
                        child3.Text = child3.Name = "child3";
@@ -985,12 +986,14 @@ namespace MonoTests.System.Windows.Forms
 
                                child1 = new Form ();
                                child1.Name = "child1";
+                               child1.Text = "child1";
                                child1.MdiParent = main;
                                child1.WindowState = FormWindowState.Maximized;
                                child1.Show ();
                                
                                child2 = new Form ();
                                child2.Name = "child2";
+                               child2.Text = "child2";
                                child2.MdiParent = main;
                                child2.Show();