xUnit SDK
Living documentation for .NET projects. Write tests that double as documentation β from unit-level specifications to full end-to-end API journeys.
Three Ways to Document Your Codeβ
BDD Features
Gherkin-style Given / When / Then scenarios that read like plain English. Perfect for acceptance tests and business-facing documentation.
Specifications
Lightweight, developer-focused rules for unit and component tests. Less ceremony than BDD β ideal for testing algorithms and edge cases.
Journey Testing
End-to-end API testing with annotated .http files. Your API journeys work as both manual exploration tools and automated regression tests with response contract validation.
Quick Startβ
dotnet add package SweDevTools.LiveDoc.xUnit
[Feature("Shopping Cart")]
public class CartTests : FeatureTest
{
public CartTests(ITestOutputHelper output) : base(output) { }
[Scenario("Adding an item increases the count")]
public void AddItem()
{
var cart = new Cart();
Given("an empty cart", () => { });
When("I add '1' item", () => cart.Add("Widget"));
Then("the cart contains '1' item", () =>
Assert.Equal(1, cart.Count));
}
}
dotnet test --logger LiveDoc
Full getting started guide β