Clean up DuplicatePropertyNameHandling feature

This commit is contained in:
James Newton-King
2018-11-24 21:25:20 +13:00
parent a1f1b0aa86
commit 88dae52165
10 changed files with 132 additions and 49 deletions
@@ -1761,12 +1761,11 @@ third line", jsonTextReader.Value);
}
";
JsonLoadSettings settings = new JsonLoadSettings {DuplicatePropertyNamesHandling = DuplicatePropertyNamesHandling.Throw};
JsonLoadSettings settings = new JsonLoadSettings {DuplicatePropertyNameHandling = DuplicatePropertyNameHandling.Error};
ExceptionAssert.Throws<JsonException>(() => JObject.Parse(json, settings));
JsonTextReader reader = new JsonTextReader(new StringReader(json));
ExceptionAssert.Throws<JsonException>(() =>
{
JsonTextReader reader = new JsonTextReader(new StringReader(json));
JToken.ReadFrom(reader, settings);
});
}