Writing unit and integration tests for your ASP.NET Core controllers

Posted: (EET/GMT+2)

 

If you are looking for nice guidance on how to implement automatic testing on ASP.NET Core applications, Microsoft has written a new article titled "Test controller logic in ASP.NET Core".

Since lot of the UI work has moved from ASP.NET controllers and their views to the front-end, I find writing unit and integration tests most useful for API controllers. In this case, by API controllers I mean controller action methods that return objects (as in JSON encoded format) instead of regular HTML code or snippets.

In case you are interested in learning more how to improve your automatic tests, be sure to check out Microsoft's own recommendations.

Happy testing!