Unit testing controllers
The ASP.NET Core MVC Controller classes handle users interactions, which translates to the request on the browser. The controller gets the appropriate model and selects a view to render that displays the user interface. The controller reads a user's input data, events, and interactions from the view, and passes it to the model. The controller validates the input it receives from the view and then performs the business operation that modifies the state of the data model.
The Controller classes should be lightweight and contain the minimal logic needed to render the view based on a user's interactions to allow easy testing and maintenance. The controller should verify the state of the model and ascertain the validity, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access