public void Test() { NLog.Config.SimpleConfigurator.ConfigureForConsoleLogging(LogLevel.Trace); var loggerFactory = new NLogLoggerFactory(); var log = loggerFactory.GetLogger("Test"); Assert.IsInstanceOf <NLogLogger>(log); CallAllMethodsOnLog(log); log = loggerFactory.GetLogger(typeof(LoggerFactoryTests)); CallAllMethodsOnLog(log); }
public void Test() { NLog.Config.SimpleConfigurator.ConfigureForConsoleLogging(LogLevel.Trace); var loggerFactory = new NLogLoggerFactory(); var log = loggerFactory.GetLogger("Test"); Assert.IsInstanceOf<NLogLogger>(log); CallAllMethodsOnLog(log); log = loggerFactory.GetLogger(typeof(LoggerFactoryTests)); CallAllMethodsOnLog(log); }
public void CanCreateLoggerFromNameWithLoggerFactory() { var loggerFactory = new NLogLoggerFactory(); var logger = loggerFactory.GetLogger("logger name"); Assert.NotNull(logger); Assert.AreEqual("logger name", logger.Name); }
public void CanCreateLoggerFromTypeWithLoggerFactory() { var loggerFactory = new NLogLoggerFactory(); var logger = loggerFactory.GetLogger(GetType()); Assert.NotNull(logger); Assert.AreEqual(GetType().FullName, logger.Name); }
public void CanCreateLoggerFromCurrentInstanceWithLogger() { var loggerFactory = new NLogLoggerFactory(); var testLogger = loggerFactory.GetLogger("TestLogger"); var logger = testLogger.GetCurrentInstanceLogger(); Assert.NotNull(logger); Assert.AreEqual(GetType().FullName, logger.Name); }