Render() public method

Render the value to the output.
public Render ( TextWriter output, string format = null, IFormatProvider formatProvider = null ) : void
output System.IO.TextWriter The output.
format string A format string applied to the value, or null.
formatProvider IFormatProvider A format provider to apply to the value, or null to use the default.
return void
Exemplo n.º 1
0
        public void ADictionaryValueRendersAsMappingOfKeysToValues()
        {
            var dict = new DictionaryValue(new[] {
                new KeyValuePair<ScalarValue, LogEventPropertyValue>(
                    new ScalarValue(1), new ScalarValue("hello")),
                new KeyValuePair<ScalarValue, LogEventPropertyValue>(
                    new ScalarValue("world"), new SequenceValue(new [] { new ScalarValue(1.2)  }))
            });

            var sw = new StringWriter();
            dict.Render(sw);

            var rendered = sw.ToString();

            Assert.AreEqual("[(1: \"hello\"), (\"world\": [1.2])]", rendered);
        }