Author: rolf
Date: 2006-11-09 04:56:27 -0500 (Thu, 09 Nov 2006)
New Revision: 67585

Modified:
   trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TrackBarTest.cs
Log:
 2006-11-09  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>

        * TrackBarTest.cs: Added tests for bug #79718.



Modified: 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog   
2006-11-09 09:46:01 UTC (rev 67584)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog   
2006-11-09 09:56:27 UTC (rev 67585)
@@ -1,3 +1,7 @@
+2006-11-09  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>
+
+       * TrackBarTest.cs: Added tests for bug #79718.
+       
 2006-11-08  Gert Driesen  <[EMAIL PROTECTED]>
 
        * TextBoxTest.cs: Added test for bug #79851.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TrackBarTest.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TrackBarTest.cs 
    2006-11-09 09:46:01 UTC (rev 67584)
+++ 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TrackBarTest.cs 
    2006-11-09 09:56:27 UTC (rev 67585)
@@ -94,6 +94,7 @@
                [Test]
                public void OrientationSizeTest ()
                {       
+                       IntPtr handle;
                        int width;
                        int height ;
                        using (TrackBar myTrackBar = new TrackBar()) {
@@ -109,9 +110,9 @@
                                        width = myTrackBar.Width;
                                        height = myTrackBar.Height;
                                        myForm.Controls.Add(myTrackBar);
-                                       IntPtr handle = myTrackBar.Handle; // 
causes the handle to be created.
+                                       handle = myTrackBar.Handle; // causes 
the handle to be created.
                                        myTrackBar.Orientation = 
Orientation.Vertical;
-                                       Assert.AreEqual(height, 
myTrackBar.Width,  "#OS3");
+                                       Assert.AreEqual(45, myTrackBar.Width,  
"#OS3");
                                        Assert.AreEqual(width, 
myTrackBar.Height, "#OS4");
                                }
                        }
@@ -119,13 +120,144 @@
                        using (Form myForm = new Form()) {
                                using ( TrackBar myTrackBar = new TrackBar()) {
                                        myForm.Controls.Add(myTrackBar);
-                                       IntPtr handle = myTrackBar.Handle; // 
causes the handle to be created.
+                                       handle = myTrackBar.Handle; // causes 
the handle to be created.
                                        myTrackBar.Width = 200;
                                        myTrackBar.Orientation = 
Orientation.Vertical;
                                        Assert.AreEqual(200, myTrackBar.Height, 
"#OS5");
                                }
                        }
+                       Assert.AreEqual(handle, handle, "Removes warning");
                }
+                       
+               [Test]
+               public void SizeTest ()
+               {
+                       IntPtr handle;
+                       
+                       using (TrackBar myTrackBar = new TrackBar()) {
+                               myTrackBar.Width = 200;
+                               myTrackBar.Height = 250;
+                               Assert.AreEqual(200, myTrackBar.Width, 
"#SIZE01");
+                               Assert.AreEqual(45, myTrackBar.Height, 
"#SIZE02");
+                       }
+                       
+                       using (TrackBar myTrackBar = new TrackBar()) {
+                               myTrackBar.Width = 200;
+                               myTrackBar.Height = 250;
+                               myTrackBar.Orientation = Orientation.Vertical;
+                               Assert.AreEqual(200, myTrackBar.Width, 
"#SIZE03");
+                               Assert.AreEqual(45, myTrackBar.Height, 
"#SIZE04");
+                       }
+
+                       using (TrackBar myTrackBar = new TrackBar()) {
+                               myTrackBar.AutoSize = false;
+                               myTrackBar.Width = 200;
+                               myTrackBar.Height = 250;
+                               Assert.AreEqual(200, myTrackBar.Width, 
"#SIZE05");
+                               Assert.AreEqual(250, myTrackBar.Height, 
"#SIZE06");
+                       }
+
+                       using (TrackBar myTrackBar = new TrackBar()) {
+                               myTrackBar.AutoSize = false;
+                               myTrackBar.Width = 200;
+                               myTrackBar.Height = 250;
+                               myTrackBar.Orientation = Orientation.Vertical;
+                               Assert.AreEqual(200, myTrackBar.Width, 
"#SIZE07");
+                               Assert.AreEqual(250, myTrackBar.Height, 
"#SIZE08");
+                       }
+
+                       using (TrackBar myTrackBar = new TrackBar()) {
+                               myTrackBar.Width = 200;
+                               myTrackBar.Height = 250;
+                               myTrackBar.AutoSize = false;
+                               Assert.AreEqual(200, myTrackBar.Width, 
"#SIZE09");
+                               Assert.AreEqual(45, myTrackBar.Height, 
"#SIZE10");
+                       }
+
+                       using (TrackBar myTrackBar = new TrackBar()) {
+                               myTrackBar.Width = 200;
+                               myTrackBar.Height = 250;
+                               myTrackBar.AutoSize = false;
+                               myTrackBar.Orientation = Orientation.Vertical;
+                               Assert.AreEqual(200, myTrackBar.Width, 
"#SIZE11");
+                               Assert.AreEqual(45, myTrackBar.Height, 
"#SIZE12");
+                       }
+       
+                       using (TrackBar myTrackBar = new TrackBar()) {
+                               using (Form myForm = new Form()) {
+                                       myForm.Controls.Add(myTrackBar);
+                                       myTrackBar.Width = 200;
+                                       myTrackBar.Height = 250;
+                                       myTrackBar.Orientation = 
Orientation.Vertical;
+                                       handle = myTrackBar.Handle;
+                                       
+                                       Assert.AreEqual(45, myTrackBar.Width, 
"#SIZE17");
+                                       Assert.AreEqual(45, myTrackBar.Height, 
"#SIZE18");
+                               }
+                       }
+
+                       using (TrackBar myTrackBar = new TrackBar()) {
+                               using (Form myForm = new Form()) {
+                                       myForm.Controls.Add(myTrackBar);
+                                       myTrackBar.Width = 200;
+                                       myTrackBar.Height = 250;
+                                       myTrackBar.Orientation = 
Orientation.Vertical;
+                                       handle = myTrackBar.Handle;
+                                       
+                                       Assert.AreEqual(45, myTrackBar.Width, 
"#SIZE19");
+                                       Assert.AreEqual(45, myTrackBar.Height, 
"#SIZE20");
+                               }
+                       }
+
+                       using (TrackBar myTrackBar = new TrackBar()) {
+                               using (Form myForm = new Form()) {
+                                       myForm.Controls.Add(myTrackBar);
+                                       myTrackBar.Width = 200;
+                                       myTrackBar.Height = 250;
+                                       myTrackBar.Orientation = 
Orientation.Vertical;
+                                       myTrackBar.Orientation = 
Orientation.Horizontal;
+                                       handle = myTrackBar.Handle;
+                                       
+                                       Assert.AreEqual(200, myTrackBar.Width, 
"#SIZE21");
+                                       Assert.AreEqual(45, myTrackBar.Height, 
"#SIZE22");
+                               }
+                       }
+
+                       using (TrackBar myTrackBar = new TrackBar()) {
+                               using (Form myForm = new Form()) {
+                                       myForm.Controls.Add(myTrackBar);
+                                       myTrackBar.Width = 200;
+                                       myTrackBar.Height = 250;
+                                       myTrackBar.Orientation = 
Orientation.Vertical;
+                                       handle = myTrackBar.Handle;
+                                       
+                                       myTrackBar.Orientation = 
Orientation.Horizontal;
+                                       
+                                       Assert.AreEqual(45, myTrackBar.Width, 
"#SIZE23");
+                                       Assert.AreEqual(45, myTrackBar.Height, 
"#SIZE24");
+                               }
+                       }
+                       
+                       using (TrackBar myTrackBar = new TrackBar()) {
+                               myTrackBar.AutoSize = false;
+                               myTrackBar.Height = 50;
+                               myTrackBar.Width = 80;
+                               myTrackBar.Orientation = Orientation.Vertical;
+                               myTrackBar.Width = 100;
+                               
+                               Assert.AreEqual(50, myTrackBar.Height, 
"#SIZE2_1");
+                               Assert.AreEqual(100, myTrackBar.Width, 
"#SIZE2_2");
+                               
+                               using (Form myForm = new Form()){
+                                       myForm.Controls.Add(myTrackBar);
+                                       myForm.Show();
+                                       
+                                       Assert.AreEqual(50, myTrackBar.Height, 
"#SIZE2_3");
+                                       Assert.AreEqual(100, myTrackBar.Width, 
"#SIZE2_4");
+                               }
+                       }
+                       Assert.AreEqual(handle, handle, "Removes warning");
+               }
+       }
 }
-}
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to