example code from top-of-my-head, probably has syntax error, but...
void Setup(string value)
{
mockedHttpHandler.When(HttpMethod.Post, "some-url")
.WithBody<MyClass>(
r =>
{
return r.Value= value
}
)
.RespondJson(_ =>
{
return new Response()
}
}
If i configure the same endpoint twice with differenet 'value':
Setup("dog");
Setup("cat");
then calling the url twice from my test
client.PostAsync(new MyClass{ Value = "dog"});
client.PostAsync(new MyClass{ Value = "cat"});
the JsonContentMatcher during second (cat) call will fail, because its already been matched and run once during the first (dog) evaluation, the content stream has already been read, the pointer is at the end of the stream, hence nothing will be deserialized on line 44 in JsonContentMatcher
var deserializedContent = Deserialize(message.Content.ReadAsStream());
version 7.0.0.
similar issue: #21
example code from top-of-my-head, probably has syntax error, but...
If i configure the same endpoint twice with differenet 'value':
then calling the url twice from my test
the JsonContentMatcher during second (cat) call will fail, because its already been matched and run once during the first (dog) evaluation, the content stream has already been read, the pointer is at the end of the stream, hence nothing will be deserialized on line 44 in JsonContentMatcher
var deserializedContent = Deserialize(message.Content.ReadAsStream());version 7.0.0.
similar issue: #21