Sebschauer.SchauerLib.Assertions.MsTest
0.0.1-alpha2
This is a prerelease version of Sebschauer.SchauerLib.Assertions.MsTest.
dotnet add package Sebschauer.SchauerLib.Assertions.MsTest --version 0.0.1-alpha2
NuGet\Install-Package Sebschauer.SchauerLib.Assertions.MsTest -Version 0.0.1-alpha2
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="Sebschauer.SchauerLib.Assertions.MsTest" Version="0.0.1-alpha2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sebschauer.SchauerLib.Assertions.MsTest" Version="0.0.1-alpha2" />
<PackageReference Include="Sebschauer.SchauerLib.Assertions.MsTest" />
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 Sebschauer.SchauerLib.Assertions.MsTest --version 0.0.1-alpha2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Sebschauer.SchauerLib.Assertions.MsTest, 0.0.1-alpha2"
#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 Sebschauer.SchauerLib.Assertions.MsTest@0.0.1-alpha2
#: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=Sebschauer.SchauerLib.Assertions.MsTest&version=0.0.1-alpha2&prerelease
#tool nuget:?package=Sebschauer.SchauerLib.Assertions.MsTest&version=0.0.1-alpha2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Sebschauer.SchauerLib.Assertions.MsTest
What it is
This nuget contains some MSTest Assert extensions for handling multiple assertions which depend on each other's assertion result:
EitherOr(assertions)and its aliasXor(assertions): Passes if exact one of the passed assertions passes and all others are failing.NeitherNor(assertion): Passes if all passed assertions are failing.Or(assertions): Passes if at least one of the passed assertions passes.PassesExactly(min, max, assertions): Passes if the number of passing assertions lies in the inclusive rangemin <= passings <= max. Ignores Checking a range boundary if it is null.IfPass(assertion1).Then(assertion2).Else(assertion3), its aliasIfand the opposite functionIfFailcheckassertion2only ifassertion1passed (or failed in the latter case), else (if defined) it checksassertion3.
Example
Assert.That.EitherOr(
() => Assert.Equal(2, primeNumber),
() => Assert.Equal(1, primeNumber % 2)
);
Assert.That
.IfFail(() => Assert.Equal(0, x))
.Then( () => Assert.NotEqual(0, 1 / x))
.Else( () => Assert.Equal("impossible", divisionState));
Resources
Source: https://github.com/sebschauer/schauerlib
Documentation: https://github.com/sebschauer/schauerlib/wiki
Changelog
v0.0.1 - 2025/12/18
First version with EitherOr, Or, NeitherNor, PassesExactly, If/IfPass().Then and IfFail().Then
Copyright & License
Copyright Sebastian Schauer 2025
Published under GPL-3.0-or-later
Questions: schauerlib@sebschauer.de
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- MSTest.TestFramework (>= 3.0.4)
- Sebschauer.SchauerLib.Assertions.Core (>= 0.0.1-alpha2)
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.1-alpha2 | 0 | 12/19/2025 |