2 // HScrollPropertiesTest.cs
\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
12 // The above copyright notice and this permission notice shall be
\r
13 // included in all copies or substantial portions of the Software.
\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
23 // Copyright (c) 2007 Jonathan Pobst
\r
26 // Jonathan Pobst (monkey@jpobst.com)
\r
30 using NUnit.Framework;
\r
31 using System.Drawing;
\r
32 using System.Windows.Forms;
\r
34 namespace MonoTests.System.Windows.Forms
\r
37 public class HScrollPropertiesTests : TestHelper
\r
40 public void Constructor ()
\r
42 ScrollableControl sc = new ScrollableControl ();
\r
43 ScrollProperties sp = sc.HorizontalScroll;
\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
55 public void PropertyEnabled ()
\r
57 ScrollableControl sc = new ScrollableControl ();
\r
58 ScrollProperties sp = sc.HorizontalScroll;
\r
61 Assert.AreEqual (false, sp.Enabled, "B1");
\r
65 public void PropertyLargeChange ()
\r
67 ScrollableControl sc = new ScrollableControl ();
\r
68 ScrollProperties sp = sc.HorizontalScroll;
\r
70 sp.LargeChange = 25;
\r
71 Assert.AreEqual (25, sp.LargeChange, "B1");
\r
75 public void PropertyMaximum ()
\r
77 ScrollableControl sc = new ScrollableControl ();
\r
78 ScrollProperties sp = sc.HorizontalScroll;
\r
81 Assert.AreEqual (200, sp.Maximum, "B1");
\r
85 public void PropertyMinimum ()
\r
87 ScrollableControl sc = new ScrollableControl ();
\r
88 ScrollProperties sp = sc.HorizontalScroll;
\r
91 Assert.AreEqual (20, sp.Minimum, "B1");
\r
95 public void PropertySmallChange ()
\r
97 ScrollableControl sc = new ScrollableControl ();
\r
98 ScrollProperties sp = sc.HorizontalScroll;
\r
100 sp.SmallChange = 5;
\r
101 Assert.AreEqual (5, sp.SmallChange, "B1");
\r
105 public void PropertyValue ()
\r
107 ScrollableControl sc = new ScrollableControl ();
\r
108 ScrollProperties sp = sc.HorizontalScroll;
\r
111 Assert.AreEqual (10, sp.Value, "B1");
\r
115 public void PropertyVisible ()
\r
117 ScrollableControl sc = new ScrollableControl ();
\r
118 ScrollProperties sp = sc.HorizontalScroll;
\r
121 Assert.AreEqual (true, sp.Visible, "B1");
\r