public void GetDefaultConfigRules_ShouldReturnJsonConfigWithRules()
        {
            // arrange
            var configFileGenerator = new ConfigFileGenerator();

            // act
            var configString = configFileGenerator.GetDefaultConfigRules();

            ParsingUtility.TryParseJson(configString, out var configJson);

            // assert
            Assert.IsNotNull(configJson["rules"]);
        }
예제 #2
0
 private void LoadConfigFromJson(string jsonConfigString)
 {
     if (ParsingUtility.TryParseJson(jsonConfigString, out var token))
     {
         SetupRules(token);
         SetupPlugins(token);
         SetupParser(token);
         IsConfigLoaded = true;
     }
     else
     {
         reporter.Report("Config file is not valid Json.");
     }
 }
예제 #3
0
 public void ValidJson(string testString)
 {
     Assert.IsTrue(ParsingUtility.TryParseJson(testString, out var token));
     Assert.IsNotNull(token);
 }
예제 #4
0
 public void InvalidJson(string testString)
 {
     Assert.IsFalse(ParsingUtility.TryParseJson(testString, out var token));
     Assert.IsNull(token);
 }