Fluent.Unions.Verify
1.1.0
dotnet add package Fluent.Unions.Verify --version 1.1.0
NuGet\Install-Package Fluent.Unions.Verify -Version 1.1.0
<PackageReference Include="Fluent.Unions.Verify" Version="1.1.0" />
<PackageVersion Include="Fluent.Unions.Verify" Version="1.1.0" />
<PackageReference Include="Fluent.Unions.Verify" />
paket add Fluent.Unions.Verify --version 1.1.0
#r "nuget: Fluent.Unions.Verify, 1.1.0"
#:package Fluent.Unions.Verify@1.1.0
#addin nuget:?package=Fluent.Unions.Verify&version=1.1.0
#tool nuget:?package=Fluent.Unions.Verify&version=1.1.0
![]()
Fluent.Unions.Verify
Makes Verify snapshots of Result, Result<T>, your own result types, Option<T> and Loadable<T> readable: the case and its data, with no stack trace. It builds on Fluent.Unions and Verify.
Installation
dotnet add package Fluent.Unions.Verify
Usage
Call VerifyFluentUnions.Initialize() once, for example from a module initializer in the test project.
using System.Runtime.CompilerServices;
using Fluent.Unions.Verify;
public static class ModuleInitializer
{
[ModuleInitializer]
public static void Initialize() => VerifyFluentUnions.Initialize();
}
Then verify results and options like any other value.
await Verify(Result.From(42));
await Verify(Option.Some(7));
{
Ok: 42
}
{
Some: 7
}
An error is written as { Error: { Type, Message } }, an Option<T> as None or { Some: value }, and a Loadable<T> as NotLoaded, Loading, { Value: value } or { Error: ... }. An error of your own result type is written as data. Initialize also tells Verify to leave stack traces out of exceptions.
License of Verify
Verify is MIT source, but its binaries carry the Open Source Maintenance Fee EULA: organisations with an annual gross revenue of US$10,000 or more pay a maintenance fee. Verify flows transitively through this package, so its build check (error SC021) asks every consuming project to declare a license position. Set one of these MSBuild properties in your test project or in Directory.Build.props:
Verify_GitHubSponsorAccount: sponsor on GitHub Sponsors.Verify_SponsorshipLicensedUntil: a time-bounded license, asyyyy-MM.Verify_SponsorshipExemptionwithVerify_SponsorshipExemptionUntil: a publisher-defined exemption such asOpenSourceorSmallRevenue.
See the Verify maintenance fee for the current terms and options.
With your own result type
Verify snapshots any result type, including one declared with [FluentResult<TError>]. A value-less success writes Ok, a result with a value writes { Ok: ... }, and an error is written as data as before. See Your own Result type.
Documentation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Fluent.Unions (>= 1.1.0)
- Verify (>= 33.7.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.