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
<PackageReference Include="aweXpect.Core" Version="4.2.0" />
<PackageVersion Include="aweXpect.Core" Version="4.2.0" />
<PackageReference Include="aweXpect.Core" />
paket add aweXpect.Core --version 4.2.0
#r "nuget: aweXpect.Core, 4.2.0"
#:package aweXpect.Core@4.2.0
#addin nuget:?package=aweXpect.Core&version=4.2.0
#tool nuget:?package=aweXpect.Core&version=4.2.0
aweXpect.Core
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:
- Generated expectations: the method, name and texts,
nullsubjects, questions that cannot be answered, collections - Constraints and results: constraints, results, negated expectations, argument validation, continuing with the value
- Message conventions: the shape of a failure message, the expectation and result texts, vocabulary and grammar
- Formatting: formatting values and value formatters
- Options: expectations with options and options of your own
- Comparisons: equality expectations, custom match types and property comparisons
- Collections: collection subjects, expectations on collection items and expected collections
- Nested expectations: expectations on a member and continuing with a new subject
- Repeated checks and synchronous boundaries
- Customization values: values and customization groups of your own
- Test frameworks and initialization: module initializers and test framework adapters
- Native AOT for extensions: keeping an extension trimmable and AOT compatible
| Product | Versions 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. |
-
.NETStandard 2.0
- Microsoft.Bcl.TimeProvider (>= 10.0.14)
- System.Threading.Tasks.Extensions (>= 4.6.3)
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
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 |