Esempio n. 1
0
        public void SelfDiagnosticsConfigParser_TryParseFileSize_MissingField()
        {
            string configJson = @"{
                    ""LogDirectory"": ""Diagnostics"",
                    ""size"": 1024
                    }";

            Assert.False(SelfDiagnosticsConfigParser.TryParseFileSize(configJson, out int fileSize));
        }
Esempio n. 2
0
        public void SelfDiagnosticsConfigParser_TryParseFileSize()
        {
            string configJson = @"{
                    ""LogDirectory"": ""Diagnostics"",
                    ""FileSize"": 1024
                    }";

            Assert.True(SelfDiagnosticsConfigParser.TryParseFileSize(configJson, out int fileSize));
            Assert.Equal(1024, fileSize);
        }
Esempio n. 3
0
        public void SelfDiagnosticsConfigParser_TryParseFileSize_CaseInsensitive()
        {
            string configJson = @"{
                    ""LogDirectory"": ""Diagnostics"",
                    ""fileSize"" :
                                   2048
                    }";

            Assert.True(SelfDiagnosticsConfigParser.TryParseFileSize(configJson, out int fileSize));
            Assert.Equal(2048, fileSize);
        }