Summary

Completed

In this module, you learned how to use GitHub Copilot and Visual Studio Code to create and maintain unit tests for C# projects. You examined the Visual Studio Code testing environment provided by the .NET SDK and the C# Dev Kit extension, including Test Explorer, run and debug commands, and the supported test frameworks (xUnit, NUnit, and MSTest). You then used the GitHub Copilot Chat view in Agent mode to generate unit tests with the /setupTests and /tests slash commands, and saw how Ask mode helps you explore edge cases and testing options before letting the Agent change any files.

You also explored how the Plan agent and longer Agent sessions extend the workflow for larger testing tasks. The Plan agent produces a reviewable test strategy before any code is written, and the Agent automates multi-file workflows that scaffold projects, generate tests, and run the resulting suite. Finally, you learned how ghost text suggestions extend coverage from inside the editor, and how Test Explorer's Fix Test Failure button and the /fixTestFailure slash command help you diagnose and resolve failing tests.

The main takeaway is that GitHub Copilot lets you move through every stage of the unit testing workflow—setup, generation, extension, and repair—without leaving Visual Studio Code, while the C# Dev Kit keeps the test project organized and runnable.

Additional Reading: