Testing .NET Code in Visual Studio 2019
Visual Studio 2019 has great support and new features for unit tests. This course will show you how to write and run unit tests in Visual Studio 2019 helping you write rock-solid applications.
What you'll learn
At the core of writing robust .NET code is a thorough knowledge of testing. In this course, Testing .NET Code in Visual Studio 2019, you will explore the skills you need to test your .NET code in Visual Studio 2019. First, you will learn how to create a test project and how to write and run unit tests. Next, you will discover how to write data-driven tests and how to work with the popular test frameworks MSTest, NUnit, and xUnit. Finally, you will see how to analyze the code coverage of your tests and how to run tests in real-time with Live Unit Testing. When you’re finished with this course, you’ll have a foundational knowledge of testing .NET Code in Visual Studio 2019 that will help you as you move forward to test and implement your own .NET projects. This course was recorded using the preview version of Visual Studio 16.2 to reflect what the user interface will look like going forward.
Table of contents
- Introduction 1m
- Implement Your First Test Method 6m
- Fake Dependencies with Moq 7m
- Initialize Tests 6m
- Check if Stock of Coffee Cups Was Exceeded 4m
- Assert Exceptions 7m
- Start the Coffee Cup Order Admin Tool 2m
- Target .NET Core and .NET Framework 7m
- Create and Use Playlists 4m
- Run Tests with Shortcuts and CodeLens 5m
- Summary 1m
Course FAQ
Unit testing is the practice of testing the smallest individual components or units of a code to determine if it works properly and is ready for use. This helps find and protect against bugs that could break the code.
In this course you will learn how to write and run unit tests in Visual Sutdio 2019 for .NET code. Some of the topics covered include:
- Creating a test project
- How to write and run unit tests
- How to write data-driven tests
- Test frameworks MSTest, NUnit, and xUnit
- Analyzing code coverage
- Live Unit Testing
- Much more
This course is for anyone who wants to learn how to perform unit tests on .NET code in Visual Studio.
Before taking this course you should be familiar with C# programming basics. If you need a refresher, or to learn for the first time, check out this C# course.