How to configure xUnit.net

Configuration of xUnit.net comes in two flavors. xUnit.net allows the configuration file to be JSON or XML-based. The xUnit.net configuration must be done for each assembly under test. The configuration file to be used for xUnit.net is dependent on the development platform of the application being tested, though the JSON configuration file can be used on all platforms.

To use a JSON configuration file, after creating your test project in Visual Studio 2017, you should add a new JSON file to the root folder of the test project and name it xunit.runner.json:

After adding the file to the project, you must instruct Visual ...

Get C# and .NET Core Test Driven Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.