Discover, browse, and organize C# unit tests by category — with MSTest, NUnit, and xUnit support — grouped by test category, right from the VS Code sidebar.
Features
Test Explorer
- Automatically discovers all C# test files in your workspace
- Parses test classes and test methods (supports
[TestMethod],[Test],[Fact],[Theory]) - Supports data-driven tests (
[DataRow],[TestCase],[InlineData]) — all rows are aggregated and the worst-case status (failed > skipped > passed) is shown per test method - Run all tests, test classes, or individual tests with a single click
- View test results with pass/fail/skip status and duration
Tests by Category
- Automatically reads categories from test attributes:
- MSTest:
[TestCategory("CategoryName")] - NUnit:
[Category("CategoryName")] - xUnit:
[Trait("Category", "CategoryName")]
- MSTest:
- Groups tests by their categories in a dedicated sidebar view
- Run all tests in a specific category
- See uncategorized tests in a separate group
Dashboard
- Visual progress bar showing test health
- Pass/fail/skip counts with percentages
- Per-category breakdown with mini progress indicators
Watch Mode
- Automatically re-runs tests when
.csfiles change - Toggle on/off from the status bar or toolbar
GitHub Copilot Integration
- Language model tools that Copilot can invoke automatically in Agent Mode
- Get test summaries, list failing tests, run all tests, run tests by category, run a specific test class, and list available categories
Requirements
- .NET SDK installed and
dotnetavailable in PATH - A C# project with unit tests (MSTest, NUnit, or xUnit)
Extension Settings
| Setting | Default | Description |
|---|---|---|
csharpTestExplorer.include |
**/*.cs |
Glob pattern for C# test files to include |
csharpTestExplorer.exclude |
**/obj/** |
Glob pattern for files to exclude |
csharpTestExplorer.dotnetTestArgs |
"" |
Additional arguments to pass to dotnet test |
csharpTestExplorer.noBuild |
false |
Skip rebuilding the project before each test run. Leave false (the default) so source changes (e.g. adding or removing [Ignore]) are always picked up. Set to true only when you want faster runs on a project you know is already up-to-date. |
csharpTestExplorer.excludeProjects |
[] |
List of project name patterns to exclude from build and discovery. Supports glob wildcards: *.Playwright, MyApp.E2E*, SpecFlow*. |
GitHub Copilot Integration
If you have GitHub Copilot installed, this extension provides language model tools that Copilot can use automatically in Agent Mode.
Available Tools
| Tool | What it does | Example prompt |
|---|---|---|
#csharpTestSummary |
Returns pass/fail/skip counts | "How are my backend C# tests doing?" |
#csharpFailedTests |
Lists all failing tests with error details | "What .NET tests are failing?" |
#csharpRunAllTests |
Runs all tests via dotnet test |
"Run all the backend tests" |
#csharpRunTestsByCategory |
Runs tests by category name | "Run backend tests with category Smoke" |
#csharpRunClassTests |
Runs all tests in a specific test class | "Run backend tests for UserServiceTests" |
#csharpListCategories |
Lists all categories with test counts | "What categories do my C# tests have?" |
How to Use
- Open Copilot Chat in VS Code.
- Switch to Agent Mode.
- Ask about your C# tests (e.g. "Run the smoke tests", "What tests are failing?", "Run tests for UserServiceTests").
- Copilot identifies the right tool, shows a confirmation, and executes it.
- Test results update in the C# Test Explorer · Copilot Ready sidebar in real time.
Note: GitHub Copilot is not required to use this extension. All sidebar features work independently.
Usage
- Open a workspace containing a C# test project
- Click the beaker icon in the Activity Bar to open C# Test Explorer · Copilot Ready
- Browse tests in the Test Explorer or Tests by Category view
- Click the play button to run tests
- View results in the Dashboard