Instructor-led training
Test-Driven Development Using Visual Studio and C# Training in Lebanon, Tennessee
An emerging software engineering paradigm is test-driven development, where tests are written early and testing is performed continuously during the development process.
What you'll learn
Private Training for Teams
This course is offered as private, instructor-led training for organizations, onsite in Lebanon, Tennessee 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 Unit Testing Framework
- Expected Exceptions
- Custom Asserts
- Playlists
- Debugging Unit Tests
- MSTest
- Refactoring
What makes test-driven development hard to master
The unit testing framework is the easy part. The hard part is working in a different order: writing a test before the code it exercises, and letting the tests drive the design. The syllabus builds the practice in layers.
- Method first. Module 1 separates functional (customer) tests from unit (programmer) tests, then covers test automation, simple design and refactoring. Developers often conflate the two kinds of test, or treat refactoring as optional cleanup. In TDD, refactoring is the step that safely follows a passing test.
- Framework mechanics. Module 2 covers the structure of a unit test, assertions, test cases, test classes, test runners, ignoring tests, and initialization and cleanup. A common mistake is putting shared state in setup code so that tests depend on each other or on execution order.
- Finer control. Module 3 covers expected exceptions, custom asserts, playlists, debugging unit tests and MSTest, and returns to refactoring. These topics matter once a suite grows past a handful of tests.
Two misconceptions are worth naming. One is that a high count of passing tests means good tests. A test with weak assertions passes while proving little. The other is that TDD only applies to new code. The syllabus includes a section on TDD with legacy code, where the difficulty is adding tests around code that was not written to be tested.
Who it suits and where it fits in a learning path
This is a one-day, general-level course for developers who already write C# in Visual Studio and have basic .NET Framework knowledge. It suits individual developers starting to add unit tests, and teams that want a shared vocabulary and workflow for TDD before applying it to a project.
If your team is newer to the language or the platform, C# and .NET Essentials, Rev. 8.0 builds the C# foundation this course assumes. For broader platform knowledge, .NET Framework Using C# covers more depth, so the testing day can then focus on technique rather than language basics.
The course uses Visual Studio 2019, which Microsoft lists as extended support only, until April 2029. Organizations working with other Visual Studio or .NET releases can request a training proposal to discuss private training tailored to the versions they use.
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.
- Adding tests to an inherited codebase. A team might maintain a line-of-business application with no tests. The legacy-code topic and the refactoring material suggest a path: pin down current behavior with automated tests, then refactor in small steps with the tests as a safety net.
- Specifying error behavior. A developer writing a validation routine might use expected-exception tests to state what must happen on bad input before writing the routine. Custom asserts can then wrap a repeated check, such as comparing a domain object field by field.
- Keeping a growing suite usable. A team might use test initialization and cleanup to keep tests independent, ignore a test that is blocked on another team, and use playlists to run a focused subset while debugging a failing test.
AI coding assistants and TDD
AI coding assistants can draft test classes, boilerplate setup and a spread of input cases quickly. That is useful once you understand the structure of a unit test and the assertion types.
They fail in predictable ways for these topics:
- Tests that mirror the code. An assistant given an implementation often writes tests that assert whatever the code currently does, bugs included. That defeats TDD, where the test states intent first.
- Weak or missing assertions. Generated tests may run the code without checking meaningful results, or may check only the happy path.
- Hidden coupling. Generated setup and cleanup can share state between tests, so results change with execution order.
- Wrong or nonexistent APIs. Assistants mix attribute and assertion names across test frameworks, or use members that do not exist in the targeted framework version.
To verify: write or review the test before the implementation and confirm it fails for the right reason. Then make it pass, and temporarily break the code to confirm a test goes red. Run tests singly and in different orders, and step through a failing test in the debugger rather than trusting a generated explanation.
Frequently asked questions
What level is this course, and what should I know first?
It is a general-level, one-day course. You should have basic knowledge of the .NET Framework and experience programming in C# with Visual Studio.
What does the course cover?
The syllabus covers TDD concepts (functional and unit tests, test automation, simple design, refactoring, TDD with legacy code), unit test structure, assertions, test cases and classes, test runners, ignoring tests, initialization and cleanup, expected exceptions, custom asserts, playlists, debugging unit tests and MSTest.
Which Visual Studio version does it use?
The course description names Visual Studio 2019, including the free Community version. Microsoft lists Visual Studio 2019 as extended support only, until April 2029.
Can this be delivered privately for our team, onsite or online?
Yes. HSG provides private training for organizations, delivered onsite at your location or live online.
Can the course be customized to our tools and versions?
Private training can be tailored to the technology versions your organization uses, including current releases, and the content can be customized. You can request a training proposal to discuss your needs.
Training locations
Test-Driven Development Using Visual Studio and C# training across the U.S. and beyond.
We provide private Test-Driven Development Using Visual Studio and C# training for organizations, onsite at your location or live online, throughout the United States and internationally.
View all Test-Driven Development Using Visual Studio and C# 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.