Пример #1
0
        public override void SetUp()
        {
            TestLoggingConfiguration cfg = new TestLoggingConfiguration();

            LogManager.Configuration = cfg;
            base.SetUp();
        }
        public void LogsUserStackFrame()
        {
            TestLoggingConfiguration cfg = new TestLoggingConfiguration();
            LogManager.Configuration = cfg;

            Common.Logging.LogManager.Adapter = new NLogLoggerFactoryAdapter(null);
            Common.Logging.LogManager.GetLogger("myLogger").Debug("TestMessage");

            Assert.IsNotNull(cfg.Target.LastLogEvent);
            string stackTrace = cfg.Target.LastLogEvent.StackTrace.ToString();
            Assert.AreSame(MethodBase.GetCurrentMethod(), cfg.Target.LastLogEvent.UserStackFrame.GetMethod());
        }
Пример #3
0
        public void LogsUserStackFrame()
        {
            TestLoggingConfiguration cfg = new TestLoggingConfiguration();

            LogManager.Configuration = cfg;

            Logging.LogManager.Adapter = new NLogLoggerFactoryAdapter((Common.Logging.Configuration.NameValueCollection)null);
            Logging.LogManager.GetLogger("myLogger").Debug("TestMessage");

            Assert.IsNotNull(cfg.Target.LastLogEvent);
            string stackTrace = cfg.Target.LastLogEvent.StackTrace.ToString();

            Assert.AreSame(MethodBase.GetCurrentMethod(), cfg.Target.LastLogEvent.UserStackFrame.GetMethod());
        }
 public override void SetUp()
 {
     TestLoggingConfiguration cfg = new TestLoggingConfiguration();
     LogManager.Configuration = cfg;
     base.SetUp();
 }