Ejemplo n.º 1
0
        public void WriteExceptionWithExceptionAndTitleAndReferenceId()
        {
            Mock<IConfigManager> configManager = GetMockConfigManager("LoggingUnitTests", "Debug");

            NLogLogWriter logWriter = new NLogLogWriter(configManager.Object);

            try
            {
                throw new ApplicationException("Oops");
            }
            catch (Exception ex)
            {
                logWriter.WriteException(ex, "WriteExceptionWithExceptionAndTitleAndReferenceId", "ExcRefID123");
                logWriter.Flush();
            }
        }
Ejemplo n.º 2
0
        public void WriteExceptionWithException()
        {
            Mock<IConfigManager> configManager = GetMockConfigManager("LoggingUnitTests", "Debug");

            NLogLogWriter logWriter = new NLogLogWriter(configManager.Object);

            try
            {
                throw new ApplicationException("Oops");
            }
            catch (Exception ex)
            {
                logWriter.WriteException(ex);
            }

            logWriter.Flush();
        }