altcode.test.xunit
2.0.48
dotnet add package altcode.test.xunit --version 2.0.48
NuGet\Install-Package altcode.test.xunit -Version 2.0.48
<PackageReference Include="altcode.test.xunit" Version="2.0.48" />
paket add altcode.test.xunit --version 2.0.48
#r "nuget: altcode.test.xunit, 2.0.48"
// Install altcode.test.xunit as a Cake Addin #addin nuget:?package=altcode.test.xunit&version=2.0.48 // Install altcode.test.xunit as a Cake Tool #tool nuget:?package=altcode.test.xunit&version=2.0.48
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 *
= ''
, 'Collection'
, '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> | |
Coverage | <sup>Coveralls</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.
Thanks to
- Coveralls for allowing free services for Open Source projects
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. 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 (>= 8.0.100)
- xunit.assert (>= 2.6.5)
-
net6.0
- FSharp.Core (>= 8.0.100)
- xunit.assert (>= 2.6.5)
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/698604d04490670a500a132a6ba2df713432a60b
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.48
• support Expecto ≥ 10.1.0, NUnit ≥ 4.0.1, Xunit ≥ 2.4.2, FSharp.Core ≥ 8.0.100
• runtime support driven by the consumed packages
◦ Expecto support on net6.0
◦ NUnit support on net462 and net6.0
◦ Xunit support on netstandard2.0
• NUnit support does not rely on the legacy ClassicAssert assembly
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