Merge pull request #1225 from strawd/bug22307
[mono.git] / mcs / class / System / Test / System.Diagnostics / SwitchesTest.cs
index c21a1ca5248f07fea0f850c000611edc762079a7..9d97fc8b53c615a8589e7fbea1a8cdc0d030038e 100644 (file)
@@ -48,12 +48,10 @@ namespace MonoTests.System.Diagnostics {
                        }
                }
 
-#if NET_2_0
                public string [] ExposeSupportedAttributes ()
                {
                        return GetSupportedAttributes ();
                }
-#endif
 
                public bool Validate ()
                {
@@ -80,6 +78,12 @@ namespace MonoTests.System.Diagnostics {
                }
        }
 
+       class TestNullSwitch : Switch {
+               public TestNullSwitch () : base (null, null)
+               {
+               }
+       }
+
        [TestFixture]
        public class SwitchesTest {
     
@@ -140,16 +144,13 @@ namespace MonoTests.System.Diagnostics {
                }
 
                [Test]
-#if NET_2_0
                [Ignore ("this test depends on 1.x configuration type")]
-#endif
                public void NewSwitch ()
                {
                        Assert.AreEqual ("42", tns.TestValue, "#NS:TestValue");
                        Assert.IsTrue (tns.Validate(), "#NS:Validate");
                }
 
-#if NET_2_0
                [Test]
                public void GetSupportedAttributes ()
                {
@@ -184,8 +185,15 @@ namespace MonoTests.System.Diagnostics {
                        BooleanSwitch s = new BooleanSwitch ("test", "", "hoge");
                        Assert.IsTrue (!s.Enabled);
                }
-#endif
+
+               [Test]
+               public void NullSwitchHasEmptyDisplayNameAndDescription ()
+               {
+                       var s = new TestNullSwitch ();
+                       Assert.IsEmpty (s.DisplayName);
+                       Assert.IsEmpty (s.Description);
+               }
        }
 }
 
-#endif
\ No newline at end of file
+#endif