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"]); }
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."); } }
public void ValidJson(string testString) { Assert.IsTrue(ParsingUtility.TryParseJson(testString, out var token)); Assert.IsNotNull(token); }
public void InvalidJson(string testString) { Assert.IsFalse(ParsingUtility.TryParseJson(testString, out var token)); Assert.IsNull(token); }