Hi Francesco,
you are totally right. There is still a lot of room for improvement. But I'm happy that the post helped you. :-)
I just realized, that codemaker asked for the complete code 2 months ago. Shame on me. I will make a GitHub repo soon und I will take care for the GetAsync case as well.
Hi Francesco,
I finally had time to create a little sample app. You can check it out on my GitHub profile under github.com/n-develop/HttpClientMock
I also checked the problem with GetAsync and found the reason. Of course, in a GET request, we don't have a body. So I added a little if (request.Content != null) in the mock class. I also updated the code in the post.
Thanks again for pointing it out. Now it should work even better.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Francesco,
you are totally right. There is still a lot of room for improvement. But I'm happy that the post helped you. :-)
I just realized, that codemaker asked for the complete code 2 months ago. Shame on me. I will make a GitHub repo soon und I will take care for the
GetAsync
case as well.Hi Francesco,
I finally had time to create a little sample app. You can check it out on my GitHub profile under github.com/n-develop/HttpClientMock
I also checked the problem with
GetAsync
and found the reason. Of course, in a GET request, we don't have a body. So I added a littleif (request.Content != null)
in the mock class. I also updated the code in the post.Thanks again for pointing it out. Now it should work even better.