Skip to main content
← Back to course

Test Explorer: Your Testing Home Base

Test Explorer is where every test in your solution lives, runs, and reports its result — no separate tool, no command line required for everyday testing work.

Open it via View → Test Explorer. It automatically discovers every test in your solution the moment you build — no manual registration, no configuration file to maintain. Add a new test method, build, and it appears.

Run tests individually, by group, or all at once. Click the play icon next to a single test to run just that one; right-click a class or namespace to run everything under it; use the top toolbar's "Run All Tests" for the whole solution. Each test shows a green check (passed), red X (failed), or gray dash (not run yet).

A failed test shows you exactly what went wrong, inline. Click a failed test to see the assertion that failed, the expected vs. actual values, and a stack trace — often enough to understand the failure without even opening the test file.

Debug a test the same way you debug any code. Right-click a test → Debug instead of Run — sets you up to step through the test (and the code it calls) with breakpoints, using everything from the Debugging Basics course.

Test Explorer works across frameworks. xUnit, NUnit, and MSTest all show up in the same Test Explorer window — Visual Studio doesn't care which framework a given project uses; the experience is consistent regardless.

Why this matters for you

A test suite you never run because it's inconvenient provides zero actual protection — Test Explorer's whole value is making "run the tests" a one-click habit instead of a chore, which is what determines whether a test suite actually gets used.

▶️ Before the next lesson

Open Test Explorer in a project that has at least one test (or add a trivial one if it doesn't), build, and confirm it appears in the list.