Verify your code works as expected. Explore the process of creating and running unit tests with Visual Studio.
Overview
Syllabus
Introduction
- Welcome
- What you should know before watching
- How to use the exercise files
- 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
- Choose a naming convention
- The Arrange, Act, Assert test pattern
- Understand pass-fail patterns
- 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
- 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
- Install nUnit
- Create and run a unit test
- Use the nUnit constraints
- More nUnit constraints
- Test parameters
- 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
- Goodbye
Taught by
Walt Ritscher