SpecFlow - Other Project Dependencies



We need to have a project reference to the class library we have created for the SpecFlow project. This is important for testing the class within the class library in the project.

Add Project Dependencies

Click on the project SpecFlowProject1 within Solution Explorer. Then right-click the folder Dependencies. Choose the option Add Project Reference.

Add Project Reference

The Reference Manager pop-up opens. Select the checkbox for the class library and then click on OK.

Reference Manager

Building and Running Tests

Next, go to the Build menu and select Build Solution. We should get Build succeeded message as output.

Build Succeeded

Navigate to the Tests menu and choose the Test Explorer option.

Build Menu

We should be able to find the Features added to the SpecFlow project. Execute them via the Run All Tests in View option. The status of the execution shows as Not Run as the tests have still not been executed.

Not Run

The exclamation symbol before a Feature suggests, test execution is pending for that Feature.

Exclamation Symbol
Advertisements