Skip to content

Alba

Open source · Critter Stack

Alba

Integration testing for ASP.NET Core

Expressive, fast HTTP integration tests that run your real application in process.

Alba runs your ASP.NET Core application in memory and gives you a scenario API for making requests and asserting on the responses: status codes, headers, JSON bodies, problem details, and anything the application wrote. There is no test server to configure and no mocking of the HTTP stack.

Alba 9 adds host pooling for parallel test runs, scenarios addressed by route name, JSON path assertions, endpoint coverage and authorization audits, and time travel with a fake TimeProvider.

What Alba Gives You

Scenario-based tests

Describe the request and the expected response in one readable block, with the real application serving it.

Authentication stubs

Run as any user or claims set without standing up an identity provider in your tests.

Parallel by design

Host pooling in Alba 9 lets large suites run scenarios concurrently without stepping on each other.

Rich assertions

JSON path and problem details assertions, server-sent events, and endpoint coverage reports.

Pairs with Wolverine and Bobcat

Wolverine.HTTP specs in Bobcat are built on Alba, so the same scenarios become readable specifications.

Mature

Alba has been testing ASP.NET Core applications since 2017 and is maintained by the Critter Stack team.

Start Here

New to Alba? These 2 posts are the ones to read first, in order.

  1. 1Alba 9 Is Nearly HereAlba 9.0 RC3 is the last release candidate before the biggest release Alba has had in years: host pooling for parallel integration tests, scenarios addressed by route name, JSON path and problem details assertions, endpoint coverage and authorization audits, time travel with a fake TimeProvider, server-sent events, and a rebuilt docs site. All of it is Jaedyn's work. Plus the breaking changes to read before you upgrade from Alba 8.
  2. 2Integration Testing with the Critter StackA live stream laying out the tools and approaches in the Critter Stack for automating integration testing, and the technical challenges you will run into along the way.

Latest on Alba

2 posts from the JasperFx blog cover Alba. Here are the most recent.

Alba 9 Is Nearly HereAlba 9.0 RC3 is the last release candidate before the biggest release Alba has had in years: host pooling for parallel integration tests, scenarios addressed by route name, JSON path and problem details assertions, endpoint coverage and authorization audits, time travel with a fake TimeProvider, server-sent events, and a rebuilt docs site. All of it is Jaedyn's work. Plus the breaking changes to read before you upgrade from Alba 8.Critter Stack in Review: October 12th to 30thCritter Stack in Review: October 12th to 30thThree weeks, 72 tagged releases, and 57 pull requests from 18 people outside JasperFx. The big themes were not losing messages, with a durable inbox and outbox hardening pass that closed a dozen community-reported ways a message could go missing; performance, from SQL Server index seeks to a thread pool thread the run command was quietly eating; shutting down cleanly; an async daemon that heals itself; and multi-tenancy at a scale we'd never tested before. Plus Marten's hard stream delete, Aspire parity in Wolverine, NServiceBus XML interop, and the upgrade notes you should read first.

Get help with Alba

JasperFx builds and maintains Alba. A support plan gives your team direct access to us; consulting and workshops get a project moving.

The Rest of the Stack