You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.
In a test I am writing, I have some assertions on the deserialized JSON that I get back from my API. The deserialization and assert looks like this:
Unfortunately, I never get to the assert. Instead, I get an ArgumentNullException from System.Linq.Enumerable.
Here's how that happens. When result.Body.Deserialize() executes, it has the following code in it:
Notice in particular the only property defined in bindingContext is DestinationType. In particular the ValidModelBindingMembers property is null.
Now, when the JsonNetBodyDeserializer Deserialize() method is executed, there is code in there that looks like this:
In other words, the argument to Except() is null, which immediately causes Except() to throw an exception.
My conclusion is that JsonNetBodyDeserializer is guarenteed never to work in this scenario.
Is this a bug, or am I somehow misusing the class in the first place?
The text was updated successfully, but these errors were encountered: