Skip to content

Features & Scenarios

Romfos edited this page Feb 26, 2026 · 5 revisions

Description

Features & scenarios are core conceptions in BddDotNet. You can thing about features as a collection of scenarios related to one problem Scenario is a single executable unit in BddDotNet

How to add a scenario

To add a scenario you need to use Scenario extension method on this IServiceCollection.

For example this is scenario with 3 steps:

services.Scenario("feature1", "scenario1", async scenario =>
{
    await scenario.Given("this is given step");
    await scenario.When("this is when step");
    await scenario.Then("this is then step");
});

Clone this wiki locally