From the course: Advanced ASP.NET Core: Unit Testing

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Set up MVC testing project

Set up MVC testing project - ASP.NET Core Tutorial

From the course: Advanced ASP.NET Core: Unit Testing

Start my 1-month free trial

Set up MVC testing project

- [Instructor] Now that we know what our app looks like let us go to Visual Studio and set up our testing project. In here we are going to create a new project, so let us right click on the solution then go to Add New Project. Search in here for xUnit because we are going to use the xUnit.net framework. Choose the option xUnit Test Project for the .NET Core and then click the Next button. In here let us provide a project name. I'll name this project LibraryApp.test and then click the Create button. Now that our project was created let us right click on the Dependencies and add the reference to the LibraryApp. So in here, check this checkbox, and then click the Okay button. When we created the project, the template, by default, created a UnitTest1.cs file. Let us rename this file to our unit testing file. So press F2 to rename this file the name of the controller that we are going to unit test. That is going to be…

Contents