Instructor-led training
Test-Driven Development Using MSTest, Rev. 8.0 Training in Wilton Manors, Florida
Private .NET training for organizations from Hartmann Software Group, delivered onsite in Wilton Manors, Florida or live online.
What you'll learn
An emerging software engineering paradigm is test-driven development, where tests are written early and testing is performed continuously during the development process. Problems are discovered early and corrected when they are found. This one-day course for developers explains the methodology of test-driven development and the use of Microsoft’s MSTest unit testing framework that comes with Visual Studio 2022, including the free Community version.
This course is designed to run on .NET 8.0, which is the current LTS (Long Term Support) version of .NET Core. .NET Core is a package-based implementation that is cross-platform, running on Mac and Linux besides Windows. .NET Framework 4.x continues to be supported. Object Innovations course 4106 covers unit testing on .NET 4.x.
The course is practical, with many example programs and tests written in C#, including a cumulative case study. The goal is to quickly bring you up to speed in doing unit testing in your .NET development projects. The student will receive a comprehensive set of materials, including course notes and all the programming examples.
Private Training for Teams
This course is offered as private, instructor-led training for organizations, onsite in Wilton Manors, Florida or live online. Dates, delivery format, and course content are arranged around your team's requirements.
This course is not currently scheduled as a public class for individual enrollment.
Request Group TrainingPrerequisites
Course Outline
1. Test-Driven Development
- What Is Test-Driven Development (TDD)?
- Functional Tests / Customer Tests
- Unit Tests / Programmer Tests
- Test Automation
- Simple Design
- Refactoring
- A Visual Studio Test Drive
- TDD with Legacy Code
2. Visual Studio Unit Testing Fundamentals
- Structure of Unit Tests
- Unit Testing Framework
- Assertions
- Test Cases
- Test Classes
- Test Runners
- Ignoring Tests
- Initialization and Cleanup
3. More about MSTest Framework
- Expected Exceptions
- Custom Asserts
- Playlists
- Debugging Unit Tests
- Command-line Test Runner
- Refactoring
What makes test-driven development hard to master
The MSTest syntax is small. The harder part is the discipline: writing a test before the code, keeping it small, and changing the design only when the tests are green. The syllabus builds in that order.
- Concepts first. The opening module separates functional (customer) tests from unit (programmer) tests, then covers test automation, simple design and refactoring. Developers often treat all of these as "tests", which leads to unit tests that are too broad or customer-level checks that are too narrow.
- Framework mechanics. Next come the structure of a unit test, assertions, test cases and classes, test runners, ignoring tests, and initialization and cleanup. Initialization and cleanup is where hidden coupling between tests first appears. A test that passes only after another one has run is a common bug.
- Failure paths and tooling. The final module covers expected exceptions, custom asserts, playlists, debugging tests and the command-line runner. Testing that code fails correctly is a separate skill from testing that it succeeds.
Common misconceptions: that TDD is just "writing tests afterward", that a high pass count means good design, and that an Ignored test is harmless. Refactoring appears in both the first and last modules because it is the step that gives the tests their value. The course also includes TDD with legacy code, where the code was not written to be testable.
Who this course suits and what to take around it
This is a one-day, general-level course for C# developers. It assumes basic .NET Core knowledge and C# experience in Visual Studio. It also suits training managers who want a team to share one vocabulary and workflow for unit testing.
The course uses .NET 8 and Visual Studio 2022 (the Community edition works). Microsoft's lifecycle information lists .NET 8 support as ended in November 2026, so the course fits teams that build, maintain or migrate code on that version. Visual Studio 2022 and 2026 are both listed as supported. Organizations on a newer .NET release can request a training proposal for private training tailored to the versions they use.
- Before: if your C# is rusty or you are new to .NET, C# and .NET Essentials, Rev. 8.0 builds the language and platform foundation that the test examples assume.
- After: once unit tests are routine, ASP.NET Core MVC (VS2022) is a natural way to apply the habit to web application code.
More options are in the .NET courses and learning guide.
Illustrative scenarios
The scenarios below are illustrations of how the course material can be applied. They are not descriptions of specific organizations or of the course's lab exercises.
- Inherited code with no tests. A team might take over a business-rules library that nobody dares change. The TDD with legacy code topic, together with refactoring and automated runs, shows how to pin down current behavior with tests before restructuring.
- Failure behavior that must be specified. For example, a team might require that invalid input to a calculation routine throw a particular exception. Expected-exception tests and custom asserts let them state that rule once and have it checked on every run.
- Tests in the build. A team might want the same tests to run from the IDE and from a build script. The command-line test runner and playlists cover this, running a fast subset locally and the full set elsewhere.
AI coding assistants and unit testing
AI coding assistants can draft test classes, test cases and initialization boilerplate quickly. That helps with repetitive setup and with listing input cases you might miss.
They fail in ways this course's topics expose:
- Tests written from the code, not the requirement. A generated test often restates what the implementation does, so it passes even when the behavior is wrong. That defeats the test-first idea of tests as a specification.
- Weak assertions. Tests may assert too little, or something that is always true. Check each assertion against the behavior you intended.
- Exception and cleanup mistakes. Expected-exception tests can pass for the wrong reason, and generated initialization and cleanup can leak state between tests.
- APIs that do not exist. Generated code can use members that are missing from the .NET and MSTest versions you target.
To verify: make each new test fail first for the right reason, then make it pass. Temporarily break the code and confirm the test notices. Run tests in isolation and in a different order, and review any generated Ignore attributes.
Frequently asked questions
What level is this course?
General level, one day. It is aimed at developers who already write C# and want to learn test-driven development and MSTest.
What should I know beforehand?
Basic knowledge of .NET Core and experience programming in C# with Visual Studio. Prior unit testing experience is not listed as a prerequisite.
What does the course cover?
TDD concepts (customer versus programmer tests, test automation, simple design, refactoring, TDD with legacy code), MSTest fundamentals (assertions, test classes and cases, runners, ignoring tests, initialization and cleanup), and further topics: expected exceptions, custom asserts, playlists, debugging tests and the command-line runner. The examples are written in C# and include a cumulative case study.
Can it be delivered privately, onsite or online?
Yes. HSG delivers private training for organizations, either onsite at the client's location or live online.
Can the content be customized?
Private course content can be customized, including to the .NET and Visual Studio versions your team uses. Use the training proposal request to describe your needs.
Training locations
Test-Driven Development Using MSTest, Rev. 8.0 training across the U.S. and beyond.
We provide private Test-Driven Development Using MSTest, Rev. 8.0 training for organizations, onsite at your location or live online, throughout the United States and internationally.
View all Test-Driven Development Using MSTest, Rev. 8.0 training locations
Train your team with HSG
Private, instructor-led training customized for your organization.
- Onsite or live online delivery
- Customized curriculum
- For a single employee or an entire team
- Flexible scheduling
- Experienced instructors
Questions? Call us at 303.377.6176
or email info@hartmannsoftware.com
Ready to train your team?
Let's customize this training for your organization.
Tell us about your employees, your goals, and your preferred schedule. We'll prepare a training proposal covering scope, delivery format, and pricing.