-Fixed test when assembly strong named
This commit is contained in:
@@ -271,16 +271,18 @@ namespace Newtonsoft.Json.Tests.Serialization
|
|||||||
""Manager"": null
|
""Manager"": null
|
||||||
}";
|
}";
|
||||||
|
|
||||||
ExceptionAssert.Throws<JsonSerializationException>(
|
try
|
||||||
@"Type specified in JSON '" + employeeRef + @"' is not compatible with '" + personRef + @"'. Path '$type', line 3, position 143.",
|
{
|
||||||
() =>
|
JsonConvert.DeserializeObject(json, typeof(Person), new JsonSerializerSettings
|
||||||
{
|
{
|
||||||
JsonConvert.DeserializeObject(json, typeof(Person), new JsonSerializerSettings
|
TypeNameHandling = TypeNameHandling.Objects,
|
||||||
{
|
TypeNameAssemblyFormat = FormatterAssemblyStyle.Full
|
||||||
TypeNameHandling = TypeNameHandling.Objects,
|
|
||||||
TypeNameAssemblyFormat = FormatterAssemblyStyle.Full
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
catch (JsonSerializationException ex)
|
||||||
|
{
|
||||||
|
Assert.IsTrue(ex.Message.StartsWith(@"Type specified in JSON '" + employeeRef + @"' is not compatible with '" + personRef + @"'."));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|||||||
Reference in New Issue
Block a user