[bcl] Remove more NET_2_0 checks from class libs
[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 using System;\r
30 using NUnit.Framework;\r
31 using System.Drawing;\r
32 using System.Windows.Forms;\r
33 \r
34 namespace MonoTests.System.Windows.Forms\r
35 {\r
36         [TestFixture]\r
37         public class HScrollPropertiesTests : TestHelper\r
38         {\r
39                 [Test]\r
40                 public void Constructor ()\r
41                 {\r
42                         ScrollableControl sc = new ScrollableControl ();\r
43                         ScrollProperties sp = sc.HorizontalScroll;\r
44 \r
45                         Assert.AreEqual (true, sp.Enabled, "A1");\r
46                         Assert.AreEqual (10, sp.LargeChange, "A2");\r
47                         Assert.AreEqual (100, sp.Maximum, "A3");\r
48                         Assert.AreEqual (0, sp.Minimum, "A4");\r
49                         Assert.AreEqual (1, sp.SmallChange, "A5");\r
50                         Assert.AreEqual (0, sp.Value, "A6");\r
51                         Assert.AreEqual (false, sp.Visible, "A7");\r
52                 }\r
53 \r
54                 [Test]\r
55                 public void PropertyEnabled ()\r
56                 {\r
57                         ScrollableControl sc = new ScrollableControl ();\r
58                         ScrollProperties sp = sc.HorizontalScroll;\r
59 \r
60                         sp.Enabled = false;\r
61                         Assert.AreEqual (false, sp.Enabled, "B1");\r
62                 }\r
63 \r
64                 [Test]\r
65                 public void PropertyLargeChange ()\r
66                 {\r
67                         ScrollableControl sc = new ScrollableControl ();\r
68                         ScrollProperties sp = sc.HorizontalScroll;\r
69 \r
70                         sp.LargeChange = 25;\r
71                         Assert.AreEqual (25, sp.LargeChange, "B1");\r
72                 }\r
73 \r
74                 [Test]\r
75                 public void PropertyMaximum ()\r
76                 {\r
77                         ScrollableControl sc = new ScrollableControl ();\r
78                         ScrollProperties sp = sc.HorizontalScroll;\r
79 \r
80                         sp.Maximum = 200;\r
81                         Assert.AreEqual (200, sp.Maximum, "B1");\r
82                 }\r
83 \r
84                 [Test]\r
85                 public void PropertyMinimum ()\r
86                 {\r
87                         ScrollableControl sc = new ScrollableControl ();\r
88                         ScrollProperties sp = sc.HorizontalScroll;\r
89 \r
90                         sp.Minimum = 20;\r
91                         Assert.AreEqual (20, sp.Minimum, "B1");\r
92                 }\r
93 \r
94                 [Test]\r
95                 public void PropertySmallChange ()\r
96                 {\r
97                         ScrollableControl sc = new ScrollableControl ();\r
98                         ScrollProperties sp = sc.HorizontalScroll;\r
99 \r
100                         sp.SmallChange = 5;\r
101                         Assert.AreEqual (5, sp.SmallChange, "B1");\r
102                 }\r
103 \r
104                 [Test]\r
105                 public void PropertyValue ()\r
106                 {\r
107                         ScrollableControl sc = new ScrollableControl ();\r
108                         ScrollProperties sp = sc.HorizontalScroll;\r
109                         \r
110                         sp.Value = 10;\r
111                         Assert.AreEqual (10, sp.Value, "B1");\r
112                 }\r
113 \r
114                 [Test]\r
115                 public void PropertyVisible ()\r
116                 {\r
117                         ScrollableControl sc = new ScrollableControl ();\r
118                         ScrollProperties sp = sc.HorizontalScroll;\r
119 \r
120                         sp.Visible = true;\r
121                         Assert.AreEqual (true, sp.Visible, "B1");\r
122                 }\r
123 \r
124         }\r
125 }\r