In February, Microsoft released an update to Visual Studio 2026 that makes GitHub Copilot testing for .NET generally available. This new feature brings an AI-powered workflow for generating, building, and running tests, and lets you create tests with a single right-click.  

Key Features and Functionality 

GitHub Copilot testing for .NET works as an automated testing agent within the Visual Studio IDE.  

  • Automated Iterative process: When you start it, the agent reviews your C# code at any level, creates tests, builds the project, runs the tests, and keeps fixing issues until everything is stable.  
  • One-click entry point: You can now use this feature by right-clicking your code in the editor, choosing Co-Pilot actions, and then selecting Generate tests. The tool figures out the right scope for you.  
  • Natural Language prompts: You can also begin by typing @test in the Co-Pilot chat window and explaining in simple terms what you want to test.  
  • Framework awareness: The agent understands your solution’s answers and builds the system, and it works smoothly with XUnit, NUnit, and MS-Test.  
  • Coverage and Summary: After finishing, Co-Pilot gives you a summary in the chat window. This includes code coverage information from before and after, plus direct links to the tests it created for you to review.  

Availability 

This feature is now available in Visual Studio 2026 v18.3. You will need a paid GitHub Co-Pilot subscription (Business or Enterprise) to use it.  

GitHub Co-Pilot testing for.NET is a new feature in Co-Pilot chat built into Visual Studio. It helps automate creating, running, and testing C# code for projects, solutions, files, classes, or members. This tool is for C# developers who want to quickly set up thorough test coverage without writing every test case by hand. Co-Pilot testing can generate tests for XUnit, NUnit, and MSTest frameworks.  

GitHub Co-Pilot testing for Dotnet is different from one-time prompts in Co-Pilot Agent Mode. It gives you a guided, ongoing experience designed to generate tests. The results are consistent because they use the C# compiler and language rules, and the tool understands your code base, file structure, and testing practices to create reliable, relevant tests.  

Security Warning 

The first time you use GitHub Co-Pilot testing for Dotnet, Co-Pilot will ask for your permission to run code generated by its language module on your computer. This can include installing or restoring NuGet packages and running tests. If you do not give general consent, Co-Pilot will ask for your approval each time before it does any of these actions.

Source: Overview of GitHub Copilot testing for .NET 

Amazon

Leave a Reply

Your email address will not be published. Required fields are marked *