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())); }
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())); }
JObject AssertValidJson(Action <ILogger> act) { return(Assertions.AssertValidJson(new CompactJsonFormatter(), act)); }