-Changed enum serialization in dictionary keys to use EnumMemberAttribute

This commit is contained in:
James Newton-King
2018-01-31 15:14:03 +13:00
parent e370fc2e3a
commit c90e6e871a
4 changed files with 133 additions and 5 deletions
@@ -1451,10 +1451,8 @@ keyword such as type of business.""
{
JObject o = JObject.Parse("{'FooBarNoEnum':'SOME_OTHER_VALUE'}");
ExceptionAssert.Throws<ArgumentException>(() =>
{
o["FooBarNoEnum"].ToObject<FooBarNoEnum>();
}, "Could not convert 'SOME_OTHER_VALUE' to FooBarNoEnum.");
FooBarNoEnum e = o["FooBarNoEnum"].ToObject<FooBarNoEnum>();
Assert.AreEqual(FooBarNoEnum.SomeOtherValue, e);
}
#endif