2009-07-17 Carlos Alberto Cortez <calberto.cortez@gmail.com>
[mono.git] / mcs / class / Managed.Windows.Forms / Test / System.Windows.Forms / RowStyleTest.cs
1 //
2 // Permission is hereby granted, free of charge, to any person obtaining
3 // a copy of this software and associated documentation files (the
4 // "Software"), to deal in the Software without restriction, including
5 // without limitation the rights to use, copy, modify, merge, publish,
6 // distribute, sublicense, and/or sell copies of the Software, and to
7 // permit persons to whom the Software is furnished to do so, subject to
8 // the following conditions:
9 // 
10 // The above copyright notice and this permission notice shall be
11 // included in all copies or substantial portions of the Software.
12 // 
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
17 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
19 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 //
21 // (C) 2006 Novell, Inc.
22 //
23
24 #if NET_2_0
25
26 using System;
27 using System.Windows.Forms;
28 using System.Drawing;
29 using NUnit.Framework;
30
31 namespace MonoTests.System.Windows.Forms
32 {
33         [TestFixture]
34         public class RowStyleTest : TestHelper {
35
36                 [Test]
37                 public void CtorTest1 ()
38                 {
39                         RowStyle rs = new RowStyle ();
40                         Assert.AreEqual (0.0f, rs.Height, "1");
41                         Assert.AreEqual (SizeType.AutoSize, rs.SizeType, "2");
42                 }
43
44                 [Test]
45                 public void CtorTest2 ()
46                 {
47                         RowStyle rs = new RowStyle (SizeType.Absolute);
48                         
49                         Assert.AreEqual (0.0f, rs.Height, "1");
50                         Assert.AreEqual (SizeType.Absolute, rs.SizeType, "2");
51                 }
52
53                 [Test]
54                 public void CtorTest3 ()
55                 {
56                         RowStyle rs = new RowStyle (SizeType.Absolute, 5.0f);
57                         
58                         Assert.AreEqual (5.0, rs.Height, "1");
59                         Assert.AreEqual (SizeType.Absolute, rs.SizeType, "2");
60                 }
61
62                 [Test]
63                 [ExpectedException (typeof (ArgumentOutOfRangeException))]
64                 public void CtorTest4 ()
65                 {
66                         RowStyle rs = new RowStyle (SizeType.Absolute, -1.0f);
67                         
68                         TestHelper.RemoveWarning (rs);
69                 }
70
71                 [Test]
72                 public void HeightTest1 ()
73                 {
74                         RowStyle rs = new RowStyle ();
75                         rs.Height = 1.0f;
76                         Assert.AreEqual (1.0f, rs.Height, "1");
77                 }
78
79                 [Test]
80                 [ExpectedException (typeof (ArgumentOutOfRangeException))]
81                 public void HeightTest2 ()
82                 {
83                         RowStyle rs = new RowStyle ();
84                         rs.Height = -1.0f;
85                 }
86         }
87 }
88
89 #endif