TinyBDD — Fluent BDD for .NET, zero ceremony
Write expressive Given/When/Then tests that feel great and run anywhere (xUnit, NUnit, MSTest) without framework lock-in.
xUnit
NUnit
MSTest
Async-first
Gherkin output
Why TinyBDD
Tiny, readable core
Understand the engine in minutes and keep it close to your tests.
Fluent, async-first
Given/When/Then chains with async built in for modern test flows.
Deferred expectations
Compose reasons and hints, throw only when awaited.
Step IO lineage
Track inputs, outputs, and the current item across steps.
Assertion agnostic
Works with any assertion library you already use.
Adapters included
Optional adapters for xUnit, NUnit, and MSTest.
Gherkin reporting
Readable Given/When/Then output right in your test results.
Try it in 30 seconds
Ambient (with adapter base class or Ambient.Current set):
```csharp await Given(() => 1) .When("double", x => x * 2) .Then("== 2", v => v == 2) .AssertPassed(); ```Explicit (no base class required):
```csharp var ctx = Bdd.CreateContext(this); await Bdd.Given(ctx, "numbers", () => new[]{1,2,3}) .When("sum", (arr, _) => Task.FromResult(arr.Sum())) .Then("> 0", sum => sum > 0) .AssertPassed(); ```Documentation Map
Introduction
What TinyBDD is and when to use it.
Getting Started
Install, set up, and run your first scenario.
BDD Fundamentals
Core ideas and Gherkin-style thinking.
BDD + TDD Workflow
Practical flow from failing to passing.
Writing Scenarios
Crafting readable Given/When/Then steps.
Data and Tables
Drive tests with rich inputs and examples.
Expectations
Fluent assertions, reasons, and hints.
Step IO and State
Track state and lineage across steps.
Hooks and Lifecycle
Set up and tear down scenarios cleanly.
Test Frameworks
Adapters for xUnit, NUnit, and MSTest.
Reporting
Readable output for your test runs.
Tips and Tricks
Patterns and shortcuts for day-to-day use.
Advanced Usage
Extensions, customizations, and power moves.
Troubleshooting
Common issues and their fixes.
Samples Index
Working examples you can copy.
Tip: add [Feature], [Scenario], and [Tag] to make reports shine. Base classes emit Gherkin output automatically.