Fluent.Unions.Shouldly 1.1.0

dotnet add package Fluent.Unions.Shouldly --version 1.1.0
                    
NuGet\Install-Package Fluent.Unions.Shouldly -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.Shouldly" 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.Shouldly" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Fluent.Unions.Shouldly" />
                    
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.Shouldly --version 1.1.0
                    
#r "nuget: Fluent.Unions.Shouldly, 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.Shouldly@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.Shouldly&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Fluent.Unions.Shouldly&version=1.1.0
                    
Install as a Cake Tool

Fluent.Unions

Fluent.Unions.Shouldly

NuGet Downloads Publish Documentation

Adds ShouldBeOk, ShouldBeError, ShouldBeSome and ShouldBeNone for Result, Result<T> and Option<T> to Shouldly. The methods return the value or the error, so a test can continue, and a failure message names the actual state.

Installation

dotnet add package Fluent.Unions.Shouldly

Usage

using Shouldly;
using Fluent.Unions.Shouldly;

Result<Order> placed = await orders.PlaceAsync(request);
placed.ShouldBeOk().Total.ShouldBe(49.90m);
// passes when the order was placed with that total

Result missing = await orders.DeleteAsync(unknownId);
missing.ShouldBeError<NotFoundException>().Message.ShouldContain("was not found");
// passes when the error is a NotFoundException

customer.Nickname.ShouldBeNone();
// passes when the customer has no nickname

With your own result type

ShouldBeOk() and ShouldBeError() accept a result type you declare with [FluentResult<TError>], with a value and without (the value-less Result), and fail with the same messages. ShouldBeError() returns your declared error type. When that is an error union, ShouldBeError<NotFound>() returns the case, and fails for another case. See Your own Result type.

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 100 11/22/2026
1.0.0 97 11/21/2026
0.3.0 95 11/20/2026