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