NSpec.VsAdapter is a test adapter to run NSpec tests from Test Explorer in Visual Studio. It runs tests from projects targeting classic .NET Framework. It is available both as a Visual Studio Extension (for VS 2013, 2015) as well as a NuGet Package (for VS 2017). VS Extension for 2017 is under development.
It currently supports test projects based on .NET Framework 4.5 and later, and NSpec 1.0.x.
As an extension, it can work in Visual Studio 2013 and 2015, Community Edition and above. As a NuGet package, it can work in Visual Studio 2017, Community Edition and above.
NOTE: To work with old project.json-based .NET Core projects, please try dotnet-test-nspec runner. Support for MSBuild-based .NET Core projects is under development. Again, support for VS 2017 Extension is under development as well.
Open Extensions and Updates window from within Visual Studio and type nspec vs in search field, then download this extension showing on top. That's it.
When you want to install this extension on more than one Visual Studio version at once, or when you don't have Visual Studio already open, you can browse to this extension page on Visual Studio marketplace, download it locally to your machine and double click on grabbed VSIX file.
Open a solution in Visual Studio with at least one NSpec test project, then build all. Open VS Test Explorer window and wait until list gets populated with test specifications from all projects. Click on Run All or select some tests to be run. You can also group specifications based on project, or nspec-derived class, or trait.
This Visual Studio test adapter can be configured by using a .runsettings file (see MSDN). Currently supported file format is:
<?xml version="1.0" encoding="utf-8"?> <RunSettings> <!-- ... other settings ... --> <!-- NSpec VS Adapter --> <NSpec.VsAdapter> <LogLevel>Debug</LogLevel> </NSpec.VsAdapter> </RunSettings>
Currently supported settings are:
An example of such a file can be found in test source code at sln/test/Samples/samples.runsettings.
To check for potential breaking changes, see BREAKING-CHANGES.md.
See CONTRIBUTING doc page.