상속: Dev2.Runtime.Configuration.Settings.SettingsBase
예제 #1
0
 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);
 }
예제 #2
0
        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 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);
        }
예제 #6
0
        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 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"));
        }
예제 #9
0
        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"));
        }
예제 #10
0
 public void ToXmlExpectedReturnsXml()
 {
     var settings = new SettingsBaseMock("x", "y", "localhost");
     var result = settings.ToXml();
     Assert.IsNotNull(result);
     Assert.IsInstanceOfType(result, typeof(XElement));
 }
예제 #11
0
 public void ConstructorWithInvalidXmlArgumentExpectedThrowsNoNullAllowedException()
 {
     var settings = new SettingsBaseMock(new XElement("x", new XElement("y"), new XElement("z")), "webserverUri");
 }
예제 #12
0
 public void ConstructorWithNullWebServerUriExpectedThrowsArgumentNullException()
 {
     var settings = new SettingsBaseMock("xx", "xxx", null);
 }
예제 #13
0
 public void ConstructorWithNullDisplayNameExpectedThrowsArgumentNullException()
 {
     var settings = new SettingsBaseMock("xx", null, null);
 }
 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);
 }