altcode.test.xunit
2.0.31
See the version list below for details.
dotnet add package altcode.test.xunit --version 2.0.31
NuGet\Install-Package altcode.test.xunit -Version 2.0.31
<PackageReference Include="altcode.test.xunit" Version="2.0.31" />
paket add altcode.test.xunit --version 2.0.31
#r "nuget: altcode.test.xunit, 2.0.31"
// Install altcode.test.xunit as a Cake Addin #addin nuget:?package=altcode.test.xunit&version=2.0.31 // Install altcode.test.xunit as a Cake Tool #tool nuget:?package=altcode.test.xunit&version=2.0.31
altcode.test
Named argument wrappers for unit test frameworks to disambiguate between which argument of type 'a
is expected
and which actual
as there's no consistent ordering between libraries, and even within them (e.g. Expecto and Expecto.Flip).
What's in the box?
A core type
namespace AltCode.Test.[Expecto|NUnit|Xunit]
type AssertionMatch<'a> =
{
Actual : 'a
Expected : 'a
}
static member Create() =
{
Actual = Unchecked.defaultof<'a>
Expected = Unchecked.defaultof<'a>
}
member this.WithActual e = { this with Actual = e }
member this.WithExpected e = { this with Expected = e }
providing a F# and C#-friendly API for naming arguments
For Expecto
Contains module AltCode.Test.Expecto.AltExpect
which provides wrappers for Expecto.Expect
and AltCode.Test.Expecto.AltFlipExpect
for Expecto.Flip.Expect
with an appropriate AltCode.Test.Expecto.AssertionMatch
-typed argument in place of actual and template expectation
For Xunit
Contains class AltCode.Test.Xunit.AltAssert
which provides wrappers for Xunit.Assert
with an appropriate AltCode.Test.Xunit.AssertionMatch
-typed argument in place of actual and template expectation
For NUnit
Contains classes AltCode.Test.NUnit.Alt*Assert
which provide wrappers for the corresponding NUnit.Framework.*Assert
for *
= ''
, 'Directory'
, 'File'
and 'String'
with an appropriate AltCode.Test.Nunit.AssertionMatch
-typed argument in place of actual and template expectation; also
type Constraint<'a> =
{
Actual : 'a
Constraint : NUnit.Framework.Constraints.IResolveConstraint
}
static member Create() =
{
Actual = Unchecked.defaultof<'a>
Constraint = null
}
member this.WithActual e = { this with Actual = e }
member this.WithConstraint e = { this with Constraint = e }
and wrappers for some NUnit.Framework.Assert.That
overloads
Continuous Integration
Build | <sup>GitHub</sup> |
Building
Cross platform, dotnet code throughout.
Tooling
It is assumed that .net 7.0.100 or later is available (dotnet
) -- try https://www.microsoft.com/net/download
Bootstrapping
Start by setting up with dotnet tool restore
Then dotnet run --project ./Build/Setup.fsproj
to do the rest of the set-up.
Normal builds
Running dotnet run --project ./Build/Build.fsproj
performs a full build/package process.
Use dotnet run --project ./Build/Build.fsproj --target <targetname>
to run to a specific target.
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 was computed. 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. |
.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
- FSharp.Core (>= 6.0.0)
- xunit.assert (>= 2.4.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
This build from https://github.com/SteveGilham/altcode.test/tree/f041c1ff96cc93f6bb6a8cb89b46f5aa9cbdf1f5
Q. Never mind the fluff -- how do I get started?
A. Start with the README : https://github.com/SteveGilham/altcode.test/blob/master/README.md
2.0.31
• [BREAKING] make the AssertionMatch type specific to each package to avoid name clashes if multiple test suites are in use
• [BREAKING] remove support for obsolescing Expecto Expect.floatEqual
• [BREAKING] remove support for obsolescing NUnit Assert.AreEqual<Nullable<double>> methods
• [BREAKING] rename AltCode.Test.Xunit.AltAssert.DoesNotAssertionMatch & AssertionMatches to AltCode.Test.Xunit.AltAssert.DoesNotMatch and Matches to line up with the methods being shadowed in Xunit.Assert
• [BREAKING] in NUnit methods with ...,message, args) correctly declare args as a params object[] making the methods take variable numbers of arguments
• support netstandard2.0 only (meaning ≥ net472 compatible)
• various fixes to Expecto.Expect and Expecto.Flip.Expect support, including Stream subtypes to be passed w/o explicit coercion to base
• various fixes to Xunit.Assert, including respecting optional arguments and allowing interface subtypes to be passed w/o explicit coercion to base
• support Expecto ≥ 9.0.4, NUnit ≥ 3.13.3, Xunit ≥ 2.4.2, FSharp.Core ≥ 6.0.0
• new for Expecto.Expect
◦ equalWithDiffPrinter
◦ isFasterThan
◦ isFasterThanSub
◦ isGreaterThan
◦ isGreaterThanOrEqual
◦ isLessThan
◦ isLessThanOrEqual
where for comparisons, Actual is what's being tested and Expected is the benchmark value
• new for Expecto.Flip.Expect
◦ containsAll
◦ equalWithDiffPrinter diffPrinter message (x: AssertionMatch<'a>)
◦ isFasterThan
◦ isFasterThanSub
◦ isGreaterThan
◦ isGreaterThanOrEqual
◦ isLessThan
◦ isLessThanOrEqual
• new for Expecto.CSharp.Function, type AltCSharpExpect for the type-homogenous versions of IsFasterThan
• new for NUnit.Framework.Assert
◦ Greater
◦ GreaterOrEqual
◦ Less
◦ LessOrEqual
• new for Xunit.Assert
◦ Equal of double with MidpointRounding option
◦ Equal of double with tolerance option
◦ Equal of single ditto
◦ Equivalent
◦ NotEqual object overloads
1.0.11
• support Expecto 9.x
• support net47 and netstandard2.0 only
1.0.8
• altcode.test.nunit -- Fix classic framework support
• altcode.test.xunit -- Fix classic framework support
1.0.6
• [BREAKING] Match -> AssertionMatch
• altcode.test.expecto -- add Expecto.Flip support
• altcode.test.nunit -- add DirectoryAssert, FileAssert and StringAssert support
• altcode.test.xunit -- add AltAssert.Same
1.0.4
• [NEW PACKAGE] altcode.test.expecto -- named argument helper for Expecto ≥ 8.12.0
• [NEW PACKAGE] altcode.test.nunit -- named argument helper for NUnit ≥ 3.12.0
• [NEW PACKAGE] altcode.test.xunit -- named argument helper for Xunit ≥ 2.4.1