Exemple #1
0
        public void Load_ShouldLoadCorrectType()
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.LoadXml("<appender name=\"ColoredConsoleAppender\" type=\"log4net.Appender.ColoredConsoleAppender\">\r\n" +
                           "</appender>");

            mSut.Load(xmlDoc.FirstChild);

            Assert.AreEqual("log4net.Appender.ColoredConsoleAppender", mSut.Value);
        }
        public void Load_ShouldMaintainType_FromCtor(string type)
        {
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.LoadXml($"<appender name=\"ColoredConsoleAppender\" {type}>\r\n" +
                           "</appender>");

            mSut.Load(xmlDoc.FirstChild);

            Assert.AreEqual(AppenderDescriptor.Async.TypeNamespace, mSut.Value);
        }
Exemple #3
0
        public void Load_ShouldNotLoadType_RegularCtor(string xml)
        {
            mSut = new TypeAttribute(new ReadOnlyCollection <IProperty>(new List <IProperty>()));

            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.LoadXml($"<appender name=\"ColoredConsoleAppender\" {xml}>\r\n" +
                           "</appender>");

            mSut.Load(xmlDoc.FirstChild);

            Assert.IsNull(mSut.Value);
        }