Пример #1
0
        public void NLogLoggerAdapter_Test()
        {
            var logger = new Mock <Logger>();

            logger.CallBase = true;
            NLogLoggerAdapter target = new NLogLoggerAdapter(logger.Object);

            ExploratoryTester.TestILogger(target);
        }
Пример #2
0
        public void NOPLogger_AllLogMethodsTest()
        {
            NOPLogger logger = NOPLogger.Instance;

            List <string> failures = ExploratoryTester.TestILogger(logger);

            Assert.AreEqual(0, failures.Count,
                            failures.Count != 0 ? failures.Aggregate((s1, s2) => s1 + System.Environment.NewLine + s2) : "");
        }
        public void Log4netLoggerAdapter_Test()
        {
            var log = new Mock <Core.ILogger>();

            log.SetupGet(m => m.Name).Returns("Test logger name");
            log.Setup(m => m.IsEnabledFor(It.IsAny <Core.Level>())).Returns(true);

            var logger = new Mock <ILog>();

            logger.SetupGet(m => m.Logger).Returns(log.Object);

            Log4netLoggerAdapter target = new Log4netLoggerAdapter(logger.Object);

            ExploratoryTester.TestILogger(target);
        }