コード例 #1
0
        public void Debug_LambdaMessage()
        {
            // Prepare
            const string message = "Simple Message";
            logger.Setup(l => l.Write(
                       LogEventLevel.Debug, message, null))
                    .Verifiable();
            log = new SerilogLogger(logger.Object);

            // Act
            log.Debug(message);

            // Assert
            logger.VerifyAll();
        }
コード例 #2
0
        public void Debug_MessageWithException()
        {
            // Prepare
            const string message = "Exception occurred";
            var ex = new Exception(message);
            logger.Setup(l => l.Write(
                       LogEventLevel.Debug,ex, message, null))
                    .Verifiable();
            log = new SerilogLogger(logger.Object);

            // Act
            log.Debug(message,ex);

            // Assert
            logger.VerifyAll();
        }
コード例 #3
0
        public void Debug_FormatMessage()
        {
            // Prepare
            const string format = "Number of Call: {0} occurred";
            logger.Setup(l => l.Write(
                       LogEventLevel.Debug, format, 1))
                    .Verifiable();
            log = new SerilogLogger(logger.Object);

            // Act
            log.DebugFormat(format, 1);

            // Assert
            logger.VerifyAll();
        }
コード例 #4
0
        public void Warn_MessageOnly()
        {
            // Prepare
            const string message = "Simple Message";
            logger.Setup(l => l.Write(
                       LogEventLevel.Warning, message, null))
                    .Verifiable();
            log = new SerilogLogger(logger.Object);

            // Act
            log.Warn(message);

            // Assert
            logger.VerifyAll();
        }
コード例 #5
0
 public void TearDown()
 {
     logger = null;
     log = null;
 }