New test for ListView.Dispose firing extra Layout events.
[mono.git] / mcs / class / Managed.Windows.Forms / Test / System.Windows.Forms / HScrollPropertiesTest.cs
1 //\r
2 // HScrollPropertiesTest.cs\r
3 //\r
4 // Permission is hereby granted, free of charge, to any person obtaining\r
5 // a copy of this software and associated documentation files (the\r
6 // "Software"), to deal in the Software without restriction, including\r
7 // without limitation the rights to use, copy, modify, merge, publish,\r
8 // distribute, sublicense, and/or sell copies of the Software, and to\r
9 // permit persons to whom the Software is furnished to do so, subject to\r
10 // the following conditions:\r
11 // \r
12 // The above copyright notice and this permission notice shall be\r
13 // included in all copies or substantial portions of the Software.\r
14 // \r
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
16 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
18 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
19 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
20 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
21 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
22 //\r
23 // Copyright (c) 2007 Jonathan Pobst\r
24 //\r
25 // Authors:\r
26 //      Jonathan Pobst (monkey@jpobst.com)\r
27 //\r
28 \r
29 #if NET_2_0\r
30 using System;\r
31 using NUnit.Framework;\r
32 using System.Drawing;\r
33 using System.Windows.Forms;\r
34 \r
35 namespace MonoTests.System.Windows.Forms\r
36 {\r
37         [TestFixture]\r
38         public class HScrollPropertiesTests : TestHelper\r
39         {\r
40                 [Test]\r
41                 public void Constructor ()\r
42                 {\r
43                         ScrollableControl sc = new ScrollableControl ();\r
44                         ScrollProperties sp = sc.HorizontalScroll;\r
45 \r
46                         Assert.AreEqual (true, sp.Enabled, "A1");\r
47                         Assert.AreEqual (10, sp.LargeChange, "A2");\r
48                         Assert.AreEqual (100, sp.Maximum, "A3");\r
49                         Assert.AreEqual (0, sp.Minimum, "A4");\r
50                         Assert.AreEqual (1, sp.SmallChange, "A5");\r
51                         Assert.AreEqual (0, sp.Value, "A6");\r
52                         Assert.AreEqual (false, sp.Visible, "A7");\r
53                 }\r
54 \r
55                 [Test]\r
56                 public void PropertyEnabled ()\r
57                 {\r
58                         ScrollableControl sc = new ScrollableControl ();\r
59                         ScrollProperties sp = sc.HorizontalScroll;\r
60 \r
61                         sp.Enabled = false;\r
62                         Assert.AreEqual (false, sp.Enabled, "B1");\r
63                 }\r
64 \r
65                 [Test]\r
66                 public void PropertyLargeChange ()\r
67                 {\r
68                         ScrollableControl sc = new ScrollableControl ();\r
69                         ScrollProperties sp = sc.HorizontalScroll;\r
70 \r
71                         sp.LargeChange = 25;\r
72                         Assert.AreEqual (25, sp.LargeChange, "B1");\r
73                 }\r
74 \r
75                 [Test]\r
76                 public void PropertyMaximum ()\r
77                 {\r
78                         ScrollableControl sc = new ScrollableControl ();\r
79                         ScrollProperties sp = sc.HorizontalScroll;\r
80 \r
81                         sp.Maximum = 200;\r
82                         Assert.AreEqual (200, sp.Maximum, "B1");\r
83                 }\r
84 \r
85                 [Test]\r
86                 public void PropertyMinimum ()\r
87                 {\r
88                         ScrollableControl sc = new ScrollableControl ();\r
89                         ScrollProperties sp = sc.HorizontalScroll;\r
90 \r
91                         sp.Minimum = 20;\r
92                         Assert.AreEqual (20, sp.Minimum, "B1");\r
93                 }\r
94 \r
95                 [Test]\r
96                 public void PropertySmallChange ()\r
97                 {\r
98                         ScrollableControl sc = new ScrollableControl ();\r
99                         ScrollProperties sp = sc.HorizontalScroll;\r
100 \r
101                         sp.SmallChange = 5;\r
102                         Assert.AreEqual (5, sp.SmallChange, "B1");\r
103                 }\r
104 \r
105                 [Test]\r
106                 public void PropertyValue ()\r
107                 {\r
108                         ScrollableControl sc = new ScrollableControl ();\r
109                         ScrollProperties sp = sc.HorizontalScroll;\r
110                         \r
111                         sp.Value = 10;\r
112                         Assert.AreEqual (10, sp.Value, "B1");\r
113                 }\r
114 \r
115                 [Test]\r
116                 public void PropertyVisible ()\r
117                 {\r
118                         ScrollableControl sc = new ScrollableControl ();\r
119                         ScrollProperties sp = sc.HorizontalScroll;\r
120 \r
121                         sp.Visible = true;\r
122                         Assert.AreEqual (true, sp.Visible, "B1");\r
123                 }\r
124 \r
125         }\r
126 }\r
127 #endif