public void PatternConverterProperties()
        {
            XmlDocument log4netConfig = new XmlDocument();

            log4netConfig.LoadXml(@"
                <Soyo.Base.Log>
                  <appender name=""PatternStringAppender"" type=""UnitTest.Base.Log.PatternStringAppender"">
                    <layout type=""Soyo.Base.Text.LayoutLoggerSimple"" />
                    <setting>
                        <converter>
                            <name value=""propertyKeyCount"" />
                            <type value=""UnitTest.Base.Log.PropertyKeyCountPatternConverter"" />
                            <property>
                                <key value=""one-plus-one"" />
                                <value value=""2"" />
                            </property>
                            <property>
                               <key value=""two-plus-two"" />
                               <value value=""4"" />
                            </property> 
                        </converter>
                        <pattern value=""%propertyKeyCount"" />
                    </setting>
                  </appender>
                  <root>
                    <level value=""ALL"" />                  
                    <appender-ref ref=""PatternStringAppender"" />
                  </root>  
                </Soyo.Base.Log>");

            ILoggerController rep = LogManager.CreateController(Guid.NewGuid().ToString());

            XmlConfig.Config(rep, log4netConfig["Soyo.Base.Log"]);

            ILog log = LogManager.Get(rep.Name, "PatternConverterProperties");

            log.Debug("Message");

            PropertyKeyCountPatternConverter converter =
                PropertyKeyCountPatternConverter.MostRecentInstance;

            Assert.AreEqual(2, converter.PropertySet.Count);
            Assert.AreEqual("4", converter.PropertySet["two-plus-two"]);

            PatternStringAppender appender =
                (PatternStringAppender)LogManager.GetController(rep.Name).AppenderSet[0];

            Assert.AreEqual("2", appender.Setting.Format());
        }
 public PropertyKeyCountPatternConverter()
 {
     mostRecentInstance = this;
 }