Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

LinkedIn Learning

Visual Studio Essential Training: 09 Unit Tests

via LinkedIn Learning

Overview

Verify your code works as expected. Explore the process of creating and running unit tests with Visual Studio.

Syllabus

Introduction
  • Welcome
  • What you should know before watching
  • How to use the exercise files
1. Create a Simple Unit Test Framework
  • What are unit tests?
  • The anatomy of a unit test framework
  • Add the test projects
  • Analyze which tests to run
  • Create a simple test
  • Create a simple test runner
  • Add additional tests
  • Refactor the test runner
  • Create an Assert class
  • Use the Assert class
  • Add an attribute to the Assert class
  • Use reflection to call the test methods
2. Unit Testing Conventions
  • Choose a naming convention
  • The Arrange, Act, Assert test pattern
  • Understand pass-fail patterns
3. Work with Visual Studio Unit Testing Framework
  • Visual Studio and unit test integration
  • Choose a unit testing framework
  • Create a project with the unit test template
  • Create a project with the unit test framework: Visual Studio 2017
  • Create the unit test
  • Run the unit test
  • Modify code to pass test
  • Expected exceptions
  • Test parameters
4. Work with xUnit
  • Install xUnit
  • Create and run a unit test
  • Expected exceptions
  • Use App.config to shorten names in Test Explorer
  • Test parameters with InlineData
  • Test multiple parameters
  • Provide parameter values with a custom class member
5. Work with nUnit
  • Install nUnit
  • Create and run a unit test
  • Use the nUnit constraints
  • More nUnit constraints
  • Test parameters
6. Additional Topics
  • Group the test with test categories
  • Use additional test attributes
  • Get more from your tests
  • Customize the test runs with playlists
  • Debug unit tests
  • Use the test menus
  • View unit test results with CodeLens
  • Discover untested code with Code Coverage
  • Live unit testing
  • Run test from the command line with MSTest
Conclusion
  • Goodbye

Taught by

Walt Ritscher

Reviews

Start your review of Visual Studio Essential Training: 09 Unit Tests

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.