Precept 0.14.0

Precept.Reqnroll

Runs Reqnroll feature files on the Precept test runner. The package carries both Reqnroll plugins: the generator that turns .feature files into Precept test classes, and the runtime plugin that maps pending and ignored steps onto Precept outcomes. Nothing else is needed for Gherkin.

dotnet add package Precept.Reqnroll

A feature file and the bindings that make it run. The outline below produces two tests, one per row of its Examples: table:

Feature: Calculator

@smoke
Scenario Outline: Adding two numbers
	Given I have entered <left> into the calculator
	And I have entered <right> into the calculator
	When I press add
	Then the result should be <total> on the screen

	Examples:
		| left | right | total |
		| 1    | 2     | 3     |
		| -5   | 5     | 0     |
[Binding]
public class CalculatorSteps
{
    private readonly List<int> _operands = [];
    private int _result;

    [Given("I have entered {int} into the calculator")]
    public void GivenIHaveEntered(int number) => _operands.Add(number);

    [When("I press add")]
    public void WhenIPressAdd() => _result = _operands.Sum();

    [Then("the result should be {int} on the screen")]
    public Task ThenTheResultShouldBe(int expected) =>
        Assert.That(_result, "the screen").ToBeEqualAsync(expected);
}

Step definitions are ordinary Reqnroll [Binding] classes. Data tables, ScenarioContext, constructor injection and hooks all work unchanged. Reqnroll builds one instance per scenario, so the fields above hold a scenario's own state safely while scenarios run in parallel.

Three things to know:

  • .feature files compile on their own once this package is referenced. There is no code-behind to check in, and "Go to test" in a test explorer opens the .feature file rather than generated code.
  • Reqnroll is configured from the Reqnroll section of precept.json, so there is no reqnroll.json to keep. See configuring Reqnroll.
  • The generator emits one class per feature file, and Precept's default unit of parallelism is a class. A suite of two feature files therefore runs at most two units at once, however high MaxParallelism is. Set "ParallelScope": "Test" to schedule scenarios individually.

Part of Precept, a .NET 10 test framework built on Microsoft.Testing.Platform. Full documentation: writing tests in Gherkin · test explorer navigation · execution model · test data from Gherkin

Precept 0.14.0 · MIT · © 2026

Esc