Logo

dev-resources.site

for different kinds of informations.

Unit Tests In ASP.NET Core Controllers

Published at
5/28/2018
Categories
dotnet
testing
tutorial
unittest
Author
Matheus Rodrigues
Categories
4 categories in total
dotnet
open
testing
open
tutorial
open
unittest
open
Unit Tests In ASP.NET Core Controllers

In this new series of posts, I want to show different aspects of testing an ASP.NET core application.

I will start in this post showing how to create unit tests for controllers. Then I am going to talk integration test in the controller and explore ASP.NET core new feature, Test Host. After that, let’s see how we can test our application business logic.

Moving to the database realm. I’m going to show how we can create unit tests for code that deals with DbContext, using Entity Framework Core In-memory database feature. And them, how to do integration tests with a real database, with strategies to maintain a database for integration tests.

Let’s jump right into it!

Continue Reading...

Featured ones: