Voluble 0.1.5

dotnet add package Voluble --version 0.1.5
                    
NuGet\Install-Package Voluble -Version 0.1.5
                    
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="Voluble" Version="0.1.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Voluble" Version="0.1.5" />
                    
Directory.Packages.props
<PackageReference Include="Voluble" />
                    
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 Voluble --version 0.1.5
                    
#r "nuget: Voluble, 0.1.5"
                    
#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 Voluble@0.1.5
                    
#: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=Voluble&version=0.1.5
                    
Install as a Cake Addin
#tool nuget:?package=Voluble&version=0.1.5
                    
Install as a Cake Tool

Voluble Build and Test NuGet Version

An open-sourced alternative to expressive assertions.

Notice - This library was made as a test to see how easy it was to create expressive assertions and a bit of jab at another library whom shall not be named. Consider using Shouldly, but feel free to test this library if you want to.

Definition

(adjective)
(of a person) talking fluently, readily, or incessantly.
"a voluble game-show host"
or.
an assertion library not costing 130$ per seat.

Installation

Dotnet-Cli

dotnet add package Voluble

Features

  • Fluent assertion syntax with .Should() entry point
  • Chainable assertions
  • String assertions (contains, starts/ends with, regex matching, length)
  • Numeric assertions (comparisons, ranges, sign, approximations)
  • Collection assertions (contains, count, ordering, equivalence)
  • DateTime assertions (before/after, components, day of week)
  • Type assertions (exact type, assignability)
  • Exception assertions (sync and async)
  • Custom failure messages with because parameter
  • VolubleScope for collecting multiple assertion failures

Usage

Basic Assertions

"hello".Should().Be("hello");
42.Should().NotBe(0);
myObject.Should().NotBeNull();

String Assertions

"hello world".Should().Contain("world");
"hello world".Should().StartWith("hello");
"hello world".Should().EndWith("world");
"hello world".Should().Match(@"hello \w+");
"hello".Should().HaveLength(5);
"".Should().BeNullOrEmpty();

Numeric Assertions

42.BeGreaterThan(0);
42.BeLessThanOrEqualTo(100);
42.BeInRange(1, 50);
3.14.BeApproximately(Math.PI, tolerance: 0.01);
(-5).BeNegative();
0.BeZero();

Collection Assertions

var list = new[] { 1, 2, 3 };
list.Contain(2);
list.NotContain(5);
list.HaveCount(3);
list.NotBeEmpty();
list.BeInAscendingOrder();
list.ContainSingle(x => x > 2);
list.BeEquivalentTo(new[] { 3, 1, 2 }); // order independent

DateTime Assertions

DateTime.Now.BeAfter(DateTime.MinValue);
DateTime.Now.BeOnWeekday();
someDate.HaveYear(2025);
someDate.BeCloseTo(expectedDate, TimeSpan.FromSeconds(1));

Exception Assertions

Action act = () => throw new InvalidOperationException();
act.Should().Throw<InvalidOperationException>();

Func<Task> asyncAct = async () => await FailingMethodAsync();
await asyncAct.Should().ThrowAsync<InvalidOperationException>();

Type Assertions

object obj = "hello";
obj.Should().BeOfType<string>();
obj.Should().BeAssignableTo<IEnumerable<char>>();

Custom Failure Messages

price.Should().Be(0, because: "the cart is empty");

VolubleScope - Collect Multiple Failures

By default, assertions fail immediately. Use VolubleScope to collect all failures and report them together at the end:

using (new VolubleScope())
{
    1.Should().Be(2);  // collected, doesn't throw yet
    "a".Should().Be("b");  // collected
}  // throws here with all failures

Requirements

  • .NET 9.0 or .NET 10.0

License

Apache 2.0

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net9.0

    • No dependencies.

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
0.1.5 107 1/23/2026
0.1.4 107 1/23/2026
0.1.3 108 1/22/2026
0.1.2 118 1/4/2026
0.1.1 115 1/4/2026
0.1.0 116 1/4/2026