aweXpect.Core 4.2.0

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

aweXpect.Core

Nuget

aweXpect.Core is the engine of aweXpect and the API to write your own expectations and extension packages. It brings Expect.That, the evaluation, the failure messages, the formatting and the customization, but not the expectations for strings, numbers or collections, which are in aweXpect.

Installation

To write tests, reference aweXpect, which brings this package with it.

An extension package references aweXpect.Core instead of aweXpect, with PrivateAssets="contentfiles;build", so that its source generators also run in the projects that use the extension:

<ItemGroup>
  <PackageReference Include="aweXpect.Core" Version="…" PrivateAssets="contentfiles;build" />
</ItemGroup>

See Publishing as a package for the version, the target frameworks and the namespace of an extension.

At a glance

An expectation that only checks a condition is generated from a static method marked with [GenerateExpectation]:

using aweXpect.Core.Extending;

namespace aweXpect;

public static partial class ThatTrack
{
    [GenerateExpectation("Is{Not}RadioFriendly", "is {not} radio friendly",
        Result = nameof(DescribeDuration))]
    private static bool IsRadioFriendly(Track track)
        => track.Duration <= TimeSpan.FromMinutes(3);

    private static string DescribeDuration(Track track)
        => $"was {track.Duration:m\\:ss} long";
}

The source generator writes IsRadioFriendly() and IsNotRadioFriendly() with their failure messages, and Result names the method that describes the subject after "but". A test calls them like a built-in expectation:

Track track = new("Hey Jude", new TimeSpan(0, 7, 11));

await That(track).IsRadioFriendly();
Expected that track
is radio friendly,
but it was 7:11 long

When an expectation needs more than a condition, e.g. options, a different result or a nested expectation, add a constraint of your own through the ExpectationBuilder, see Extending aweXpect.

Documentation

The full documentation is available at docs.testably.org:

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 is compatible.  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.  net9.0 was computed.  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. 
.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 was computed. 
.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 (9)

Showing the top 5 NuGet packages that depend on aweXpect.Core:

Package Downloads
aweXpect

Assert unit tests in natural language using awesome expectations.

aweXpect.Mockolate

Expectations to verify interactions with mocks from Mockolate.

aweXpect.Testably

Expectations for the file and time system from Testably.Abstractions.

aweXpect.Snapshots

Snapshot testing for aweXpect.

aweXpect.Reflection

Expectations for reflection types for aweXpect.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.2.0 0 11/15/2026
4.1.0 128 11/13/2026
4.0.0 1,359 11/10/2026
4.0.0-pre.4 955 11/6/2026
4.0.0-pre.3 4,628 10/29/2026
4.0.0-pre.2 270 10/27/2026
4.0.0-pre.1 102 10/22/2026
3.4.0 8,404 10/17/2026
3.4.0-pre.2 916 10/17/2026
3.4.0-pre.1 296 10/16/2026
3.3.1 2,499 10/16/2026
3.3.0 6,298 10/16/2026
3.2.0 233 10/15/2026
3.1.0 1,672 10/11/2026
3.0.1 274 10/11/2026
3.0.0 2,895 10/10/2026
3.0.0-pre.24 232 10/9/2026
3.0.0-pre.23 252 10/8/2026
3.0.0-pre.22 1,463 10/8/2026
3.0.0-pre.21 862 10/8/2026
Loading failed