Test-Driven Development Using MSTest (NET4006)
Learn test-driven development with MSTest and Visual Studio through practical C# examples, automated unit testing, refactoring, and a cumulative case study.
Register or Request Training
- Private class for your team
- Live expert instructor
- Online or on‑location
- Customizable agenda
- Proposal responses same day as request
Course Overview
This one-day course introduces test-driven development and shows developers how to create and run automated unit tests with Microsoft’s MSTest framework in Visual Studio 2026.
Through practical C# examples and a cumulative case study, participants learn to write tests early, test continuously, identify problems sooner, and refactor code with confidence. Examples target .NET 10.0 and can run on Windows, macOS, and Linux.
Participants receive course notes and the programming examples used throughout the course.
Course Benefits
- Apply the core principles and workflow of test-driven development.
- Create well-structured C# unit tests using MSTest and Visual Studio.
- Use assertions, test cases, initialization, cleanup, and exception testing effectively.
- Run, organize, debug, and automate test suites with Visual Studio and command-line tools.
- Use testing and refactoring practices to identify problems earlier and improve code safely.
Delivery Methods
Delivered for your team at your site or online.
Course Outline
- Test-Driven Development
- What Is Test-Driven Development?
- Functional Tests and Customer Tests
- Unit Tests and Programmer Tests
- Test Automation
- Simple Design
- Refactoring
- A Visual Studio Test Drive
- Test-Driven Development with Legacy Code
- Visual Studio Unit Testing Fundamentals
- Structure of Unit Tests
- The Unit Testing Framework
- Assertions
- Test Cases
- Test Classes
- Test Runners
- Ignoring Tests
- Initialization and Cleanup
- More About the MSTest Framework
- Expected Exceptions
- Custom Assertions
- Playlists
- Debugging Unit Tests
- The Command-Line Test Runner
- Refactoring
Class Materials
Each student receives a comprehensive set of materials, including course notes and all class examples.
Class Prerequisites
Experience in the following is required for this ASP.NET class:
- The student should have a basic knowledge of .NET Core and experience programming in C# with Visual Studio.
Experience in the following would be useful for this ASP.NET class:
- Useful prior courses are Object-Oriented Programming in C#, or C# Essentials plus .NET Essentials.
Have questions about this course?
We can help with curriculum details, delivery options, pricing, or anything else. Reach out and we’ll point you in the right direction.