Skip to content

Feature Fixture (v2.x)

Suremaker edited this page Jan 13, 2019 · 2 revisions

Page version: 3.x / 2.x / 1.x

The FeatureFixture class is a recommended class to be used for feature tests.

Its implementation is slightly different between integration projects (depending on test framework nature), but in general it's responsibility is to:

  • provide IBddRunner instance, that would be used to run scenarios for given test class,
  • annotate the test class with FeatureFixtureAttribute to indicate that class contains LightBDD scenarios (it is required by NUnit3 and XUnit2 integration and optional for MsTest2 one),
  • dispose the underlying feature runner instance after all tests belonging for the class have finished (NUnit3),
  • provide helper properties like TestOutput in XUnit2.

It is possible to write tests without usage of this class. In order to do that, please check FeatureFixture implementation for specific test framework and repeat it in the test class:

Please note that it is possible to install class templates and project templates from Visual Studio Gallery.

Continue reading: Step Comments

Clone this wiki locally