Running xUnit.net tests using ReSharper

Categories: .NET, C#

Tags: .NET, C#, NuGet, Tools

If you have created new projects in Visual Studio recently and you use xUnit.net with ReSharper to run your tests you might find that your tests are not running. The reason for that is that xUnit.net has been updated to version 2. Also xUnit.net runner for Visual Studio is no longer needed.

Follow this steps to run the new xUnit.net 2.0

1. Install xUnit.net with the NuGet command

install-package xunit

If you check the packages.config file you’ll see that there are a few more packages added apart from xunit. One of this is the assertion library. The core framework is separated from the assertion library.

2. Install xUnit Visual Studio runner

install-package xunit.runner.visualstudio

If you don’t use ReSharper to run unit tests this should be enough otherwise follow the next step.

3. Click the Resharper>Extension Manager… Find the xUnit.net Test Support for ReSharper 9 (it should be the same for 8) and click the Update button.

Comments

comments powered by Disqus