nunittest-explorernunittestadapter

How to get a results file from Nunit Test Adapter ran in Visual Studio with Test Explorer


I have been running my tests with Specflow+ through Test Explorer in Visual Studio and a nice .html report is automatically generated at the end by the Specflow+ Runner.

I have switched to Nunit Test Runner (still running through Test Explorer).

However, at the end I can't see any results files at all xml or html?

How do I get it to generate these? Or am I looking in the wrong place?

I tried adding a .runsettings file in the root of the project containing the following code but still no results were written:

<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
    <NUnit>
        <TestOutputXml>TestResults</TestOutputXml>
    </NUnit>
</RunSettings>

Solution

  • It's necessary to tell TestExplorer to use the .runSettings file. See https://learn.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019