ZippyNeuron.Assertionz
1.0.3
dotnet add package ZippyNeuron.Assertionz --version 1.0.3
NuGet\Install-Package ZippyNeuron.Assertionz -Version 1.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZippyNeuron.Assertionz" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZippyNeuron.Assertionz" Version="1.0.3" />
<PackageReference Include="ZippyNeuron.Assertionz" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ZippyNeuron.Assertionz --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ZippyNeuron.Assertionz, 1.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ZippyNeuron.Assertionz@1.0.3
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ZippyNeuron.Assertionz&version=1.0.3
#tool nuget:?package=ZippyNeuron.Assertionz&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Assertionz
This library makes working with collections easier when unit testing.
Example Usage
AreEqual
This method compares collections based on object instance identity, not value equality. The order of elements does affect the result, each expected instance must be present in the actual collection and in the same order.
var expected =
new[] { 1, 2, 3 };
var actual =
new[] { 1, 2, 3 };
AssertCollection.AreEqual(expected, actual);
AreEquivalent
This method compares collections based on object instance identity, not value equality. The order of elements does not affect the result, but each expected instance must be present in the actual collection.
var expected =
new[] { 1, 2, 3 };
var actual =
new[] { 1, 2, 3 };
AssertCollection.AreEquivalent(expected, actual);
AreLike
The method compares each item in the expected collection to the corresponding item in the actual collection when order is observed, or checks for the presence of equivalent items when order is ignored. Item equivalence is determined by comparing property values. The collections must have the same number of items.
var expected =
new[] { 1, 2, 3 };
var actual =
new[] { 1, 2, 3 };
var ordering = AssertCollectionOrderMode.Observe
OR
var ordering = AssertCollectionOrderMode.Ignore;
AssertCollection.AreLike(expected, actual, ordering);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net48 is compatible. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.8
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.