public void ConstructorWithValidNameArgumentsExpectedSetsProperties() { var settings = new SettingsBaseMock("x", "y", "localhost"); Assert.AreEqual("x", settings.SettingName); Assert.AreEqual("y", settings.DisplayName); Assert.AreEqual("localhost", settings.WebServerUri); }
public void ConstructorWithValidXmlArgumentNullWebserverExpectedException() { var xml = new XElement("Settings", new XAttribute("DisplayName", "hello")); var settings = new SettingsBaseMock(xml, null); Assert.AreEqual("hello", settings.DisplayName); Assert.AreEqual(xml.Name, settings.SettingName); }
public void ToXmlExpectedReturnsXml() { var settings = new SettingsBaseMock("x", "y", "localhost"); var result = settings.ToXml(); Assert.IsNotNull(result); Assert.IsInstanceOfType(result, typeof(XElement)); }
public void ConstructorWithValidXmlArgumentExpectedInitializesAllProperties() { var xml = new XElement("Settings", new XAttribute("DisplayName", "hello")); var settings = new SettingsBaseMock(xml, "localhost"); Assert.AreEqual("hello", settings.DisplayName); Assert.AreEqual(xml.Name, settings.SettingName); Assert.AreEqual("localhost", settings.WebServerUri); }
public void ToXmlExpectedSerializesEachProperty() { var settings = new SettingsBaseMock("x", "y", "localhost"); var result = settings.ToXml(); Assert.AreEqual(settings.SettingName, result.Name); Assert.AreEqual(settings.DisplayName, result.AttributeSafe("DisplayName")); }
public void ConstructorWithInvalidXmlArgumentExpectedThrowsNoNullAllowedException() { var settings = new SettingsBaseMock(new XElement("x", new XElement("y"), new XElement("z")), "webserverUri"); }
public void ConstructorWithNullWebServerUriExpectedThrowsArgumentNullException() { var settings = new SettingsBaseMock("xx", "xxx", null); }
public void ConstructorWithNullDisplayNameExpectedThrowsArgumentNullException() { var settings = new SettingsBaseMock("xx", null, null); }