Code coverage can be automatically collected and displayed after running tests in the Test Explorer window in Visual Studio.

This functionality is available in Visual Studio 2019 or later.

  1. Enable the Enable Code Coverage option in the Visual Studio toolbar.
  2. Run the tests in the Test Explorer view.
    The coverage will be automatically displayed in the Coverage view.
  3. See Viewing Coverage for details about viewing coverage data.
  • No labels