protected Switch(string displayName, string description)
{
- this.name = displayName;
- this.description = description;
+ this.name = displayName ?? string.Empty;
+ this.description = description ?? string.Empty;
}
protected Switch(string displayName, string description, string defaultSwitchValue)
}
}
+ class TestNullSwitch : Switch {
+ public TestNullSwitch () : base (null, null)
+ {
+ }
+ }
+
[TestFixture]
public class SwitchesTest {
BooleanSwitch s = new BooleanSwitch ("test", "", "hoge");
Assert.IsTrue (!s.Enabled);
}
+
+ [Test]
+ public void NullSwitchHasEmptyDisplayNameAndDescription ()
+ {
+ var s = new TestNullSwitch ();
+ Assert.IsEmpty (s.DisplayName);
+ Assert.IsEmpty (s.Description);
+ }
#endif
}
}
-#endif
\ No newline at end of file
+#endif