コード例 #1
0
        public void LogsInformation()
        {
            Log4NetTracingInterceptor logger = new Log4NetTracingInterceptor("app.config");
            string infoMessage = "This is expected message";
            string expected    = string.Format("INFO - {0}\r\n", infoMessage);

            logger.Information(infoMessage);
            Assert.Equal(expected, File.ReadAllText(logFileName));
        }
コード例 #2
0
        public void LogsNullInformation()
        {
            Log4NetTracingInterceptor logger = new Log4NetTracingInterceptor("Microsoft.Rest.ClientRuntime.Tracing.Tests.dll.config");
            string infoMessage = null;
            string expected    = string.Format("INFO - {0}\r\n", infoMessage);

            logger.Information(infoMessage);
            Assert.Equal(expected, File.ReadAllText(logFileName));
        }