public void AllParametersAreSetToDefault()
        {
            var sb = new StringBuilder();
            var renderer = new AllEventPropertiesLayoutRenderer();
            var ev = BuildLogEventWithProperties();
            
            renderer.Render(sb, ev);

            Assert.Equal("a=1, hello=world, 17=100", sb.ToString());
        }
        public void CustomFormat()
        {
            var sb = new StringBuilder();
            var renderer = new AllEventPropertiesLayoutRenderer();
            renderer.Format = "[key] is [value]";
            var ev = BuildLogEventWithProperties();

            renderer.Render(sb, ev);

            Assert.Equal("a is 1, hello is world, 17 is 100", sb.ToString());
        }
        public void CustomSeparator()
        {
            var sb = new StringBuilder();
            var renderer = new AllEventPropertiesLayoutRenderer();
            renderer.Separator = " | ";
            var ev = BuildLogEventWithProperties();

            renderer.Render(sb, ev);

            Assert.Equal("a=1 | hello=world | 17=100", sb.ToString());
        }
        public void NoProperties()
        {
            var sb = new StringBuilder();
            var renderer = new AllEventPropertiesLayoutRenderer();
            var ev = new LogEventInfo();

            renderer.Render(sb, ev);

            Assert.Equal("", sb.ToString());
        }
Exemplo n.º 5
0
        public void AllEventPropRendererCultureTest()
        {
            string cultureName = "de-DE";
            string expected = "ADouble=1,23";   // with decimal comma

            var logEventInfo = CreateLogEventInfo(cultureName);
            logEventInfo.Properties["ADouble"] = 1.23;

            var renderer = new AllEventPropertiesLayoutRenderer();
            string output = renderer.Render(logEventInfo);

            Assert.Equal(expected, output);
        }