Exemplo n.º 1
0
        JObject AssertValidJson(Action <ILogger> act, IEnumerable <SeqPropertyItem> properties = null, int?maxRecursionLimit = null)
        {
            var logger = LogManager.GetCurrentClassLogger();
            var target = new CollectingTarget();

            SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Trace);

            act(logger);

            var formatted = new StringWriter();

            ToCompactJson(target.Events.Single(), formatted, properties?.ToList() ?? new List <SeqPropertyItem>(), maxRecursionLimit);

            return(Assertions.AssertValidJson(formatted.ToString()));
        }
Exemplo n.º 2
0
        JObject AssertValidJson(Action <ILogger> act)
        {
            var logger = LogManager.GetCurrentClassLogger();
            var target = new CollectingTarget();

            SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Trace);

            act(logger);

            var formatted = new StringWriter();

            ToCompactJson(target.Events.Single(), formatted, new List <SeqPropertyItem>());

            return(Assertions.AssertValidJson(formatted.ToString()));
        }
Exemplo n.º 3
0
 JObject AssertValidJson(Action <ILogger> act)
 {
     return(Assertions.AssertValidJson(new CompactJsonFormatter(), act));
 }