{"action":"opened","issue":{"url":"https://api.github.com/repos/AnthonySteele/MvcRouteTester/issues/62","labels_url":"https://api.github.com/repos/AnthonySteele/MvcRouteTester/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/AnthonySteele/MvcRouteTester/issues/62/comments","events_url":"https://api.github.com/repos/AnthonySteele/MvcRouteTester/issues/62/events","html_url":"https://github.com/AnthonySteele/MvcRouteTester/issues/62","id":59941504,"number":62,"title":"Assertions on Json body fail if class has enum property.","user":{"login":"phatcher","id":192778,"avatar_url":"https://avatars.githubusercontent.com/u/192778?v=3","gravatar_id":"","url":"https://api.github.com/users/phatcher","html_url":"https://github.com/phatcher","followers_url":"https://api.github.com/users/phatcher/followers","following_url":"https://api.github.com/users/phatcher/following{/other_user}","gists_url":"https://api.github.com/users/phatcher/gists{/gist_id}","starred_url":"https://api.github.com/users/phatcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phatcher/subscriptions","organizations_url":"https://api.github.com/users/phatcher/orgs","repos_url":"https://api.github.com/users/phatcher/repos","events_url":"https://api.github.com/users/phatcher/events{/privacy}","received_events_url":"https://api.github.com/users/phatcher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-05T11:51:38Z","updated_at":"2015-03-05T11:51:38Z","closed_at":null,"body":"Given a class with an enum the assertion fails if you convert the entity to json to get the post body, e.g. \r\n\r\n        [TestMethod]\r\n        public void PackagePost()\r\n        {\r\n            var package = new Package();\r\n\r\n            var packageJson = JsonConvert.SerializeObject(package);\r\n            config.ShouldMap(\"/api/Package\")\r\n                  .WithJsonBody(packageJson)\r\n                  .To<PackageController>(HttpMethod.Post, x => x.Post(package));\r\n        }\r\n\r\n        [TestMethod]\r\n        public void PackagePostJson2()\r\n        {\r\n            var package = new Package();\r\n\r\n            var packageJson = \"{ Logging: 'Basic', Synchronous: 'false' }\";\r\n            config.ShouldMap(\"/api/Package\")\r\n                  .WithJsonBody(packageJson)\r\n                  .To<PackageController>(HttpMethod.Post, x => x.Post(package));\r\n        }\r\n\r\nThe issue is that the PropertyReader.GetPropertyValue gets the enum representation rather than the json representation of the value so it fails as 'Basic' != 1.\r\n\r\nSorry for the incomplete repro but this should give the basic idea of the issue. "}}