Exemplo n.º 1
0
        public void TestAppendersIsIAppender()
        {
            var simpleLayout = new SimpleLayout();
            var xmlLayout = new XmlLayout();

            var fileAppender = new FileAppender(simpleLayout);
            IAppender fileAppenderXml = new FileAppender(xmlLayout);

            Assert.IsInstanceOfType(fileAppender, typeof(IAppender), "This fileAppender is not IAppender.");
            Assert.IsInstanceOfType(fileAppenderXml, typeof(IAppender), "This fileAppenderXml is not IAppender.");
        }
Exemplo n.º 2
0
        public void TestAppendersMissingFilePath()
        {
            var pathTxt = string.Empty;
            var pathXml = string.Empty;

            var simpleLayout = new SimpleLayout();
            var xmlLayout = new XmlLayout();

            var fileAppender = new FileAppender(simpleLayout);
            IAppender fileAppenderXml = new FileAppender(xmlLayout);

            fileAppender.File = pathTxt;
            fileAppenderXml.File = pathXml;
        }
Exemplo n.º 3
0
        public void TestAppendersFilePath()
        {
            string pathTxt = "../../log.txt";
            string pathXml = "../../log.xml";

            var simpleLayout = new SimpleLayout();
            var xmlLayout = new XmlLayout();

            var fileAppender = new FileAppender(simpleLayout);
            IAppender fileAppenderXml = new FileAppender(xmlLayout);
            
            fileAppender.File = pathTxt;
            fileAppenderXml.File = pathXml;

            Assert.AreEqual(pathTxt, fileAppender.File, "This is not same path for log.txt.");
            Assert.AreEqual(pathXml, fileAppenderXml.File, "This is not same path for log.xml.");
        }