Interface IBddReporter
- Namespace
- TinyBDD
- Assembly
- TinyBDD.dll
Defines a BDD (Behavior-Driven Development) test reporter that reports feature
execution in a Given/When/Then style.
Implementations of this interface can integrate with different testing frameworks
such as NUnit, xUnit, or MSTest, providing consistent reporting across tools.
public interface IBddReporter
Examples
var ctx = Bdd.CreateContext(this);
await Bdd.Given(ctx, "number", () => 1)
.When("+1", v => v + 1)
.Then("== 2", v => v == 2);
var reporter = new StringBddReporter();
GherkinFormatter.Write(ctx, reporter);
Console.WriteLine(reporter.ToString());
Remarks
Built-in implementations include StringBddReporter, xref:TinyBDD.NUnit.NUnitBddReporter, xref:TinyBDD.Xunit.XunitBddReporter, and xref:TinyBDD.MSTest.MsTestBddReporter. Use Write(ScenarioContext, IBddReporter) to render a scenario to a reporter.
Methods
WriteLine(string)
Writes a line of output to the BDD reporter.
This can be used to log execution steps, outcomes, or contextual messages
during the lifecycle of a feature, scenario, or step.
void WriteLine(string message)
Parameters
messagestringThe text to be written to the report output.
Typically represents a BDD step description (e.g., "Given the user is logged in").