コード例 #1
0
ファイル: CultureInfoTests.cs プロジェクト: rosj91/NLog
        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);
        }
コード例 #2
0
ファイル: CultureInfoTests.cs プロジェクト: CharlieBP/NLog
        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);
        }