Skip to main content

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.

Write your first feature β†’

πŸ“

Specifications

Lightweight, developer-focused rules for unit and component tests. Less ceremony than BDD β€” ideal for testing algorithms and edge cases.

Write your first spec β†’

πŸ—ΊοΈ

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.

Explore journey testing β†’


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 β†’


Explore the Docs​