-Fixed error in JTokenWriter when disposing after adding a duplicate property

-Fixed not validating JSON when deserializing with DataTableConverter
This commit is contained in:
James Newton-King
2014-08-17 19:42:11 +12:00
parent 73a266217b
commit dce6228b8f
5 changed files with 53 additions and 18 deletions
@@ -7892,6 +7892,18 @@ Parameter name: value",
}
#endif
[Test]
public void DuplicatePropertiesInNestedObject()
{
ExceptionAssert.Throws<ArgumentException>(
"Can not add property time to Newtonsoft.Json.Linq.JObject. Property with the same name already exists on object.",
() =>
{
string content = @"{""result"":{""time"":1408188592,""time"":1408188593},""error"":null,""id"":""1""}";
JsonConvert.DeserializeObject<JObject>(content);
});
}
[Test]
public void RoundtripUriOriginalString()
{