SpecFlow allows technologists and developers to define and execute code acceptance tests from human-readable specifications. This article provides conceptual and technical information about executing SpecFlow tests in the Ed-Fi ETL Application solution.
.
Install SpecFlow Integration for Visual Studio
To create and edit SpecFlow feature files, SpecFlow must be installed for Visual Studio. Navigate to Tools > Extensions and Updates... > Online, search for "SpecFlow," and install the SpecFlow integration feature.
Executing SpecFlow Tests with ReSharper
If your development environment has ReSharper installed, then navigate to ReSharper > Options in Visual Studio. Under Tools > Unit Testing, ensure that the option "Shadow-copy assemblies being tested" is not selected.
ReSharper provides a feature to run all tests in a Visual Studio solution or project. It also allows running specific tests directly from the Solution Explorer. Right-click on any test project, folder, or feature file and select "Run Unit Tests."
Executing SpecFlow Tests Using Visual Studio Test Runner
When SpecFlow translates a feature file to test code, it creates the tests using the NUnit framework. To run NUnit tests using the Visual Studio Test Runner, install the NUnit Test Adapter version 2.0. Navigate to Tools > Extensions and Updates... > Online and search for "NUnit Test Adapter." Install the adapter for version 2.0 tests.
To run all tests, navigate to Test > Windows > Test Explorer and select "Run All."
You can also run specific tests from the Solution Explorer. Right-click on any SpecFlow test project or SpecFlow feature file and select "Run SpecFlow Scenarios."