Hypothesist 3.0.91

dotnet add package Hypothesist --version 3.0.91
NuGet\Install-Package Hypothesist -Version 3.0.91
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Hypothesist" Version="3.0.91" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hypothesist --version 3.0.91
#r "nuget: Hypothesist, 3.0.91"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Hypothesist as a Cake Addin
#addin nuget:?package=Hypothesist&version=3.0.91

// Install Hypothesist as a Cake Tool
#tool nuget:?package=Hypothesist&version=3.0.91

nuget codecov stryker build status


The "future" assertion library for .NET, promise!

This library is there to help you do assertions on events that are about to happen in the near future. For example, when building integration tests for a subscriber on a service bus.


See the docs for the changed API since v3.


See some notes on using System.Linq.Async and FluentAssertions.




Define your hypothesis with an observer, an experiment, an a time constraint. Feed the observer with samples and validate the hypothesis:

var observer = Observer.For<int>();


You feed the observer with data:

await observer.Add(3);

For example with an injected stub:

var service = Substitute.For<SomeInjectable>();
    .When(x => x.Demo(Arg.Any<int>()))
    .Do(x => observer.Add(x.Arg<int>()));

or with a hand-rolled implementation:

class TestAdapter(Observer<int> observer) : SomeInjectable
    public Task Demo(int data) =>

var service = new TestAdapter(observer);

or with the consumer factory Hypothesist.MassTransit when using MassTransit:

cfg.ReceiveEndpoint("...", x => x.Consumer(observer.AsConsumer));

or with the handler factory Hypothesist.Rebus when using Rebus:

using var activator = new BuiltinHandlerActivator()

Just checkout the available adapters for more information!


You validate if your hypothesis holds true for the supplied samples during the specified time window.

await hypothesis

But somewhere in between you've fired off the eventing mechanism that ultimately invokes the injected service.


The two parts of the hypothesis are the experiment and a time constraint.


Validates that at least one item matches the assertion, meaning the experiment stops when this item is observed.


Validates that all items that are observed during the experiment matches the assertion.

Remark: having no items observed during the time window also means the hypothesis holds true;


Validates that the first item that is observed matches the assertion.


Validates that exactly one item is observed that matches the assertion.

Remark: having other items not matching the assert means the hypothesis still holds true.


Validates that exactly the given number of occurrences is observed that matches the assertion within the given timeframe.


Validates that at least the given number of occurrences is observed that matches the assertion.


Validates that at most the given number of occurrences is observed that matches the assertion.


Some adapters wrapping around the hypothesis to make invocation convenient:

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Hypothesist:

Package Downloads

Plugin the hypothesis as a consumer into MassTransit to validate message arrival.


Plugin the hypothesis as a handler into Rebus to validate message arrival.


Test your hypothesis easily with a ServiceBusProcessor.


Plugin the hypothesis as a middleware into aspnet to validate requests and responses.


Plugin the hypothesis as a handler into Entity Framework to validate entity events.

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on Hypothesist:

Repository Stars
🍔 A practical and imaginary food delivery microservices, built with .Net 7, MassTransit, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
Event Sourcing library for .NET
🌭 A practical and imaginary food delivery modular monolith, built with .Net 7, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
Version Downloads Last updated
3.0.91 211 3/8/2024
3.0.89 180 3/8/2024
3.0.88 917 1/11/2024
2.2.72 411 11/23/2023
2.2.71 227 11/23/2023
2.2.66 529 11/6/2023
2.2.64 196 11/6/2023
2.2.63 231 11/2/2023
2.1.62 201 11/2/2023
2.1.61 185 11/2/2023
2.1.60 211 11/1/2023
2.1.55 2,174 3/2/2023
2.1.52 532 3/2/2023
2.1.50 957 1/31/2023
2.1.49 556 1/27/2023
2.1.44 669 12/5/2022
2.1.39 621 11/30/2022
2.0.30 12,825 2/4/2022
2.0.28 880 2/4/2022
2.0.23 1,447 11/1/2021
2.0.22 918 9/14/2021
2.0.20 530 9/14/2021
2.0.17 551 9/13/2021
2.0.16 663 9/13/2021
2.0.12 1,956 6/10/2021
2.0.11 374 6/8/2021
1.3.1 380 6/2/2021