Ejemplo n.º 1
0
        public void ProcessInfoLayoutRendererCultureTest()
        {
            string cultureName = "de-DE";
            string expected = ".";   // dot as date separator (01.10.2008)

            var logEventInfo = CreateLogEventInfo(cultureName);

            var renderer = new ProcessInfoLayoutRenderer();
            renderer.Property = ProcessInfoProperty.StartTime;
            renderer.Format = "d";
            string output = renderer.Render(logEventInfo);

            Assert.Contains(expected, output);
            Assert.DoesNotContain("/", output);
            Assert.DoesNotContain("-", output);

            var renderer2 = new ProcessInfoLayoutRenderer();
            renderer2.Property = ProcessInfoProperty.BasePriority;
            renderer2.Format = "d";
            output = renderer2.Render(logEventInfo);
            Assert.True(output.Length >= 1);
            Assert.True("012345678".IndexOf(output[0]) > 0);
        }
Ejemplo n.º 2
0
        public void ProcessInfoLayoutRendererCultureTest()
        {
            string cultureName = "de-DE";
            string expected = ",";   // decimal comma as separator for ticks

            var logEventInfo = CreateLogEventInfo(cultureName);

            var renderer = new ProcessInfoLayoutRenderer();
            renderer.Property = ProcessInfoProperty.TotalProcessorTime;
            string output = renderer.Render(logEventInfo);

            Assert.Contains(expected, output);
            Assert.DoesNotContain(".", output);
        }