From the course: Visual Studio Code for .NET Developers
Unlock the full course today
Join today to access over 25,200 courses taught by industry experts.
Unit testing with Visual Studio Code
From the course: Visual Studio Code for .NET Developers
Unit testing with Visual Studio Code
- [Instructor] In this video, you'll learn how to perform unit tests for your dotnet projects using Visual Studio Code. We'll cover setting up the unit test projects, creating test cases, running tests, and analyzing the test results. The first thing we're going to do is restructure our project. In a situation where I want to add unit test to an existing application, or I'm starting one from scratch and want to make sure that I have unit test to cover the code logic, I usually separate the code out into two folders. I'll put the main application in a source folder and I'll put the unit test in its own folder called Tests. Let's start by creating a new source folder and let's select all of the other files and drag them into the source folder. As you can see, MyProject now lives inside of Source. Unfortunately, Visual Studio is going to throw an error because it can no longer see the project file and it doesn't know how to…