iQuarc.xUnitEx 1.1.1

dotnet add package iQuarc.xUnitEx --version 1.1.1
                    
NuGet\Install-Package iQuarc.xUnitEx -Version 1.1.1
                    
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="iQuarc.xUnitEx" Version="1.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="iQuarc.xUnitEx" Version="1.1.1" />
                    
Directory.Packages.props
<PackageReference Include="iQuarc.xUnitEx" />
                    
Project file
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 iQuarc.xUnitEx --version 1.1.1
                    
#r "nuget: iQuarc.xUnitEx, 1.1.1"
                    
#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 iQuarc.xUnitEx@1.1.1
                    
#: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=iQuarc.xUnitEx&version=1.1.1
                    
Install as a Cake Addin
#tool nuget:?package=iQuarc.xUnitEx&version=1.1.1
                    
Install as a Cake Tool

#xUnitEx - xUnit extensions

A set of extensions to help in unit testing using xUnit.

Assert Equivalent Extensions

A set of extensions for collection tests.

AssertEx.AreEquivalent<T>(IEnumerable<T> actual, params T[] expected)

Verifies that the specified collections are equivalent. Two collections are equivalent if they have the same elements in the same quantity, but in any order. Elements are equal if their values are equal, not if they refer to the same object.

	IEnumerable<string> e = new List<string> { "a", "b" };
	AssertEx.AreEquivalent(e, "b", "a");

AssertEx.AreEquivalent<T>(IEnumerable<T> actual, Func<T, T, bool> equality, params T[] expected)

Verifies that the specified collections are equivalent by using a custom equality function. Two collections are equivalent if they have the same elements in the same quantity, but in any order. Elements are equal if their values are equal, not if they refer to the same object.

	IEnumerable<string> e = new List<string> { "a", "b" };
	AssertEx.AreEquivalent(e, (s1, s2) => s1.Equals(s2, StringComparison.OrdinalIgnoreCase), "A", "B");

Assert Exception Extensions

A set of extensions for exception tests.

AssertEx.ShouldThrow(this Action act)

Assertion that fails if the specified Action does not throw any exception.

	Action act = () => { throw new Exception(); };
    act.ShouldThrow();

AssertEx.ShouldThrow<TException>(this Action act)

Assertion that fails if the specified Action does not throw the specified type of exception (TException). If other types of exceptions are thrown or no exception is thrown, the assert fails.

	ApplicationException ex = new ApplicationException();
    Action act = () => { throw ex; };
    act.ShouldThrow<ApplicationException>();

AssertEx.ShouldThrow<TException>(this Action act, string message)

Assertion that fails with the specified message if the specified Action does not throw the specified type of exception (TException). If other types of exceptions are thrown or no exception is thrown, the assert fails.

	ApplicationException ex = new ApplicationException();
    Action act = () => { throw ex; };
    act.ShouldThrow<ApplicationException>("Method did not throw an ApplicationException");

AssertEx.ShouldNotThrow(this Action act)

Assertion fails if any type of exception is thrown.

	Action act = () => { };
	act.ShouldNotThrow();

AssertEx.ShouldNotThrow<TException>(this Action act)

Assertion that fails if the specified Action throws the specified type of exception (TException). If other types of exceptions are thrown or no exception is thrown, the assert succeeds.

	Action act = () => { throw new InvalidOperationException(); };
	act.ShouldNotThrow<ArgumentException>();

AssertEx.ShouldNotThrow<TException>(this Action act, string message)

Assertion that fails with the specified message if the specified Action throws the specified type of exception (TException) or a derived type. If other types of exceptions are thrown or no exception is thrown, the assert succeeds.

	Action act = () => { throw new InvalidOperationException(); };
	act.ShouldNotThrow<ArgumentException>("ArgumentException was thrown when it shouldn't have been.");
Product 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

    • xunit (>= 1.9.2 && < 2.0.0)

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.1 149 6/5/2025

Initial set of extensions for xUnit