2006-12-19 Daniel Nauck <dna@mono-project.de>
[mono.git] / mcs / class / Managed.Windows.Forms / Test / System.Windows.Forms / StatusBarPanelTest.cs
1 //
2 // StatusBarPanelTest.cs: Test cases for StatusBar.
3 //
4 // (C) 2006 Novell, Inc. (http://www.novell.com)
5 //
6
7 using System;
8 using NUnit.Framework;
9 using System.Windows.Forms;
10 using System.Drawing;
11 using System.Runtime.Remoting;
12
13 namespace MonoTests.System.Windows.Forms
14 {
15         [TestFixture]
16         public class StatusBarPanelTest 
17         {
18                 [Test]
19                 public void MinimumWidth1 ()
20                 {
21                         StatusBarPanel p = new StatusBarPanel ();
22                         Assert.AreEqual (10, p.MinWidth, "1");
23                 }
24
25                 [Test]
26                 public void MinimumWidth2 ()
27                 {
28                         StatusBarPanel p = new StatusBarPanel ();
29                         p.Width = 50;
30                         p.MinWidth = 100;
31                         Assert.AreEqual (100, p.Width, "1");
32                 }
33
34                 [Test]
35                 public void MinimumWidth3 ()
36                 {
37                         StatusBarPanel p = new StatusBarPanel ();
38                         p.Width = 50;
39                         p.MinWidth = 200;
40                         p.MinWidth = 25;
41                         Assert.AreEqual (200, p.Width, "#1");
42                         
43                         p = new StatusBarPanel ();
44                         p.Width = 50;
45                         p.MinWidth = 25;
46                         Assert.AreEqual (50, p.Width, "#2");
47                         
48                         p = new StatusBarPanel ();
49                         p.Width = 50;
50                         p.MinWidth = 100;
51                         Assert.AreEqual (100, p.Width, "#3");
52                         
53                         p = new StatusBarPanel ();
54                         p.MinWidth = 200;
55                         Assert.AreEqual (200, p.Width, "#4");
56                 }
57                 
58                 [Test]
59                 [ExpectedException(typeof(ArgumentException))]
60                 public void MinimumWidth4 ()
61                 {
62                         StatusBarPanel p = new StatusBarPanel ();
63                         p.MinWidth = -50;
64                 }
65
66                 [Test]
67                 public void MinWidth_AutoSize_None ()
68                 {
69                         StatusBarPanel p = new StatusBarPanel ();
70                         p.Width = 50;
71                         Assert.AreEqual (10, p.MinWidth, "#1");
72                 }
73                 
74                 [Test]
75                 public void ToStringTest ()
76                 {
77                         StatusBarPanel p = new StatusBarPanel ();
78                         Assert.AreEqual ("StatusBarPanel: {}", p.ToString(), "1");
79
80                         p.Text = "Hello";
81                         Assert.AreEqual ("StatusBarPanel: {Hello}", p.ToString(), "2");
82
83                         p.Text = "}";
84                         Assert.AreEqual ("StatusBarPanel: {}}", p.ToString(), "3");
85                 }
86                 
87                 [Test]
88                 public void DefaultPropertiesTest ()
89                 {
90                         StatusBarPanel p = new StatusBarPanel ();
91                         Assert.AreEqual (100, p.Width, "#1");
92                         Assert.AreEqual (10, p.MinWidth, "#2");
93                         Assert.AreEqual (String.Empty, p.Text, "#3");
94                         Assert.AreEqual (HorizontalAlignment.Left, p.Alignment, "#4");
95                         Assert.AreEqual (StatusBarPanelAutoSize.None, p.AutoSize, "#5");
96                         Assert.AreEqual (StatusBarPanelBorderStyle.Sunken, p.BorderStyle, "#6");
97                         Assert.AreEqual (StatusBarPanelStyle.Text, p.Style, "#7");
98                         Assert.AreEqual (String.Empty, p.ToolTipText, "#8");
99                         
100                 }
101                 
102         }
103 }