Target frameworks
aweXpect supports test projects on .NET Framework 4.8 and on .NET 6 or later. Most expectations work the same on all of them, but some need .NET 8 or later, because they build on types or language features that only exist there.
| Target framework of the test project | Support |
|---|---|
| .NET 8 or later | all expectations |
| .NET 6 and .NET 7 | the .NET Standard 2.0 build, without the ones listed below |
| .NET Framework 4.8 | the .NET Standard 2.0 build, without the ones listed below |
A test project on .NET 8 or later can also be published with Native AOT and trimming.
.NET 8 or later
These expectations and behaviours are only available on .NET 8 or later:
- expectations for
IAsyncEnumerable<T>; DateOnlyandTimeOnly;Span<T>andReadOnlySpan<T>subjects;- collection expectations for
ImmutableArray<T>subjects; IsParsableIntofor strings;HasBufferSizefor buffered streams;- number expectations for
INumber<T>types other thanbyte,sbyte,short,ushort,int,uint,long,ulong,float,doubleanddecimal, e.g.nint,Half,Int128orBigInteger; IsPositiveandIsNegativefor unsigned numbers;- delegates that return a
ValueTaskorValueTask<T>; - a
Half,Int128orUInt128typed asobjectis equal to a number of another numeric type with the same value; - failure messages show the names
Half.MinValue,Half.MaxValue,NFloat.MinValueandNFloat.MaxValueinstead of the number.
.NET Framework
On .NET Framework, the expectations above are not available, and the rest works as on .NET 8.
Dictionaries with a custom comparer
Before .NET 5, e.g. on .NET Framework, aweXpect cannot read the key comparer of a ConcurrentDictionary<TKey, TValue>,
so its keys are compared with their own Equals, as for a dictionary whose comparer is unknown.