public void ASimplifiedStructureIsADictionary()
        {
            var simplified = RavenPropertyFormatter.Simplify(new StructureValue(new[] { new LogEventProperty("C", _scalarComplex) }));

            Assert.IsType <Dictionary <string, object> >(simplified);
            Assert.IsType <string>(((Dictionary <string, object>)simplified)["C"]);
        }
        public void WhenASequenceIsSimplifiedTheResultIsAnArray()
        {
            var simplified = RavenPropertyFormatter.Simplify(new SequenceValue(new[] { _scalarComplex }));

            Assert.IsType <object[]>(simplified);
            Assert.IsType <string>(((object[])simplified)[0]);
        }
示例#3
0
 /// <summary>
 /// Construct a new <see cref="LogEvent"/>.
 /// </summary>
 public LogEvent(Events.LogEvent logEvent, string renderedMessage)
 {
     Timestamp       = logEvent.Timestamp;
     Exception       = logEvent.Exception;
     MessageTemplate = logEvent.MessageTemplate.Text;
     Level           = logEvent.Level;
     RenderedMessage = renderedMessage;
     Properties      = new Dictionary <string, object>();
     foreach (var pair in logEvent.Properties)
     {
         Properties.Add(pair.Key, RavenPropertyFormatter.Simplify(pair.Value));
     }
 }
        public void WhenAComplexTypeIsPassedAsAScalarTheResultIsAString()
        {
            var simplified = RavenPropertyFormatter.Simplify(_scalarComplex);

            Assert.IsType <string>(simplified);
        }
 public void ASimpleNullIsNull()
 {
     Assert.Null(RavenPropertyFormatter.Simplify(null));
 }