示例#1
0
        public void NotUseFormatterIfNotExists(string template)
        {
            var context = new LogContext(LogLevel.Debug, _sender, template);
            var message = new JsonObject();

            context.RenderMessage(message).Should().BeEquivalentTo(template);
        }
示例#2
0
        public void UseFormatter()
        {
            var context = new LogContext(LogLevel.Debug, _sender, "Template", _formatter.Object);
            var message = new JsonObject();

            context.RenderMessage(message);

            _formatter.Verify(formatter => formatter
                              .Write(message, It.IsNotNull <TextWriter>()));
        }