DEV Community

Discussion on: How to test HttpClient with Moq in C#

Collapse
 
gautemeekolsen profile image
Gaute Meek Olsen

Hi thanks for the comment :)

In the first test you see I do the assert Assert.NotNull(retrievedPosts);, so it's there I would have it. Because my demo code GetPosts and CreatePost is simple it doesn't feel natural to add more assertions. But maybe one I could have added was Assert.Equal(2, retrievedPosts.Count); instead of Assert.NotNull(retrievedPosts); and there is where I would put it.