AnyUnit.Style.Nunit
1.2.2
dotnet add package AnyUnit.Style.Nunit --version 1.2.2
NuGet\Install-Package AnyUnit.Style.Nunit -Version 1.2.2
<PackageReference Include="AnyUnit.Style.Nunit" Version="1.2.2" />
<PackageVersion Include="AnyUnit.Style.Nunit" Version="1.2.2" />
<PackageReference Include="AnyUnit.Style.Nunit" />
paket add AnyUnit.Style.Nunit --version 1.2.2
#r "nuget: AnyUnit.Style.Nunit, 1.2.2"
#:package AnyUnit.Style.Nunit@1.2.2
#addin nuget:?package=AnyUnit.Style.Nunit&version=1.2.2
#tool nuget:?package=AnyUnit.Style.Nunit&version=1.2.2
AnyUnit.Style.Nunit
Roughly NUnit-compatible attributes and assertions for
AnyUnit - close enough to real
NUnit's own syntax that a test's logic often doesn't need to change, run
anywhere AnyUnit's core reaches (including browser-wasm) - not a full
reimplementation of NUnit's API (see "Not covered" below). Ported from
real NUnit's own source (see Contributors.md
for attribution).
Moving an existing NUnit test project onto this is usually a
PackageReference swap, not a source rewrite - using NUnit.Framework;
becomes using AnyUnit.Run; using AnyUnit.Style.Nunit; using AnyUnit.Constraints;,
and a fixture class needs to derive AssertionHelper for its Assert/
Log to resolve. Once it does, Assert.That(...) and every other call
inside an ordinary test method carries over completely unchanged - it's
just resolving to that instance now, the same identifier either way.
The one real, load-bearing difference (AnyUnit's Assert is an instance
property, not the fully-static class real NUnit's is - see AnyUnit's own
README for why) only actually shows up in a plain
helper class that isn't itself a fixture and wants to assert - a real
but narrow case, not something ordinary test methods ever run into.
Covers
[TestFixture](including parameterized:[TestFixture(args)]),[SetUpFixture][Test],[TestCase](including per-caseIgnore = "reason"),[Theory](including automatic enum-value expansion for a parameter with no explicit data source)[SetUp]/[TearDown]/[OneTimeSetUp]/[OneTimeTearDown][Values]/[ValueSource]/[Range]/[Random][Ignore],[Category],[Property],[Author],[Description],[Platform],[Timeout]ITestAction(method/fixture-level before/after hooks)Assert.That/Assert.AreEqual/classic-model asserts,Is/Has/Does/Throwsconstraints (viaAnyUnit.Constraints)
Not covered
Real NUnit's TestContext (no equivalent - use AppContext.BaseDirectory
for a working-directory-relative path instead) and its fully-static
Assert/Assume. The static-Assert gap is deliberate, not an
oversight: a shared/global assert can't reliably tell a test that made
real assertions and passed apart from one that made none at all and
trivially "passed" by doing nothing, whereas an instance scoped to
exactly one test's own run tracks that correctly (AssertCount, behind
the Success/NoError result distinction). A non-fixture helper class
that wants to assert throws AnyUnit.AssertionException/IgnoreException
directly instead of calling a static Assert.Fail/Assert.Ignore - the
one place this actually comes up in practice (an ordinary test method
already has a real Assert to call, via its fixture).
| 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. 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 was computed. 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
- AnyUnit (>= 1.2.2)
- AnyUnit.Constraints (>= 1.2.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.