Fluent.Unions.AwesomeAssertions 1.1.0

dotnet add package Fluent.Unions.AwesomeAssertions --version 1.1.0
                    
NuGet\Install-Package Fluent.Unions.AwesomeAssertions -Version 1.1.0
                    
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="Fluent.Unions.AwesomeAssertions" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Fluent.Unions.AwesomeAssertions" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Fluent.Unions.AwesomeAssertions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Fluent.Unions.AwesomeAssertions --version 1.1.0
                    
#r "nuget: Fluent.Unions.AwesomeAssertions, 1.1.0"
                    
#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.
#:package Fluent.Unions.AwesomeAssertions@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Fluent.Unions.AwesomeAssertions&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Fluent.Unions.AwesomeAssertions&version=1.1.0
                    
Install as a Cake Tool

Fluent.Unions

Fluent.Unions.AwesomeAssertions

NuGet Downloads Publish Documentation

Adds Should() for Result, Result<T> and Option<T> to AwesomeAssertions. It builds on Fluent.Unions, and a failure message names the actual state.

Installation

dotnet add package Fluent.Unions.AwesomeAssertions

Usage

Assert on an Ok result and its value.

using AwesomeAssertions;
using Fluent.Unions.AwesomeAssertions;

Result<Order> placed = await orders.PlaceAsync(request);
placed.Should().BeOk().Which.Total.Should().Be(49.90m);

Assert on the exception inside an error. * and ? are wildcards in the message pattern.

Result<Order> missing = await orders.FindAsync(unknownId);
missing.Should().BeError<NotFoundException>().WithMessage("Order * was not found");

Assert on an option.

Option<string> nickname = customer.Nickname;
nickname.Should().BeSomeWithValue("ada");

Assert on the inner exceptions of an aggregate error, such as the output of Validate.

registered.Should().BeAggregateError().WithInnerCount(2);

With your own result type

Should() works on a result type you declare with [FluentResult<TError>] when it has a value. There are no assertions for the value-less Result of your own type. BeError<TCase>() also matches a case inside an error union. See Your own Result type.

StockResult<Reservation> reserved = await stock.ReserveAsync(sku, quantity);
reserved.Should().BeError<OutOfStock>().Which.Sku.Should().Be("KB-1");

A default result counts as an error, so BeError() passes for it and BeOk() fails.

Documentation

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 97 11/22/2026
1.0.0 97 11/21/2026
0.3.0 100 11/20/2026
0.2.0 99 11/19/2026
0.1.0 109 11/19/2026