2009-06-06 Carlos Alberto Cortez <calberto.cortez@gmail.com>
[mono.git] / mcs / class / Managed.Windows.Forms / Test / System.Windows.Forms / ControlStyleTest.cs
index 7784adb31bc24be8a3cf69c505cd9460d53aa951..8d7cb8e142cb48943e08d6bfb4768390779a9bed 100644 (file)
@@ -14,7 +14,7 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Windows.Forms {
        [TestFixture]
-       public class TestControlStyle {
+       public class TestControlStyle  : TestHelper {
 
                static Array style_values = Enum.GetValues(typeof(ControlStyles));
                static string[] style_names = Enum.GetNames(typeof(ControlStyles));
@@ -350,14 +350,19 @@ namespace MonoTests.System.Windows.Forms {
 #endif
                        };
 
-                       Assert.AreEqual(LinkLabel_want, GetStyles(new LinkLabel()), "LinkLabelStyles");
+                       LinkLabel link = new LinkLabel ();
 
-                       // Test LinkLabel with a link
-                       LinkLabel link = new LinkLabel();
+                       // Test LinkLabel without text and without links
+                       Assert.AreEqual(LinkLabel_want, GetStyles(link), "#1");
+
+                       // Test LinkLabel with only text
                        link.Text = "Users need not fear making the switch to Linux";
-                        link.Links.Add (6,9, "http://link1");
-                       Assert.AreEqual(LinkLabel_link_want, GetStyles(link), "LinkLabelStyles2");
+                       link.Links.Clear ();
+                       Assert.AreEqual (LinkLabel_want, GetStyles (link), "#2");
 
+                       // Test LinkLabel with a link
+                       link.Links.Add (6, 9, "http://link1");
+                       Assert.AreEqual(LinkLabel_link_want, GetStyles(link), "#3");
                }
 
                [Test]