Search code examples
c#nunitnunit-3.0nunit-console

NUnit 3 console runner - How to run a specific .playlist file?


Is it possible to use the NUnit3 Console Runner to run a .playlist file saved from Visual Studio's Test Explorer?

I looked into the documentation but couldn't find anything for a .playlist file. Only for a file containing a list of project names. But a list is different from a xml .playlist file.


Solution

  • No, there is currently no option to run a Visual Studio .playlist file in the core functionality of the console runner.

    The closest equivalent currently in NUnit is --testList, which is a file just containing the names of every test. Looking at a playlist file, it looks like it would be simple-ish to write something to extract the testnames from a playlist and turn it into a testlist.

    The other thing I thought briefly about was whether it would be possible to implement a .playlist file reader using the NUnit Console extensibility functionality. I don't think it would be currently - as there's no extensibility around setting the test filter - but someone may correct me on that one. Would be an interesting new feature for the extensibility too!