fm.Extensions.Testing
9.0.0
dotnet add package fm.Extensions.Testing --version 9.0.0
NuGet\Install-Package fm.Extensions.Testing -Version 9.0.0
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="fm.Extensions.Testing" Version="9.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="fm.Extensions.Testing" Version="9.0.0" />
<PackageReference Include="fm.Extensions.Testing" />
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 fm.Extensions.Testing --version 9.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: fm.Extensions.Testing, 9.0.0"
#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 fm.Extensions.Testing@9.0.0
#: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=fm.Extensions.Testing&version=9.0.0
#tool nuget:?package=fm.Extensions.Testing&version=9.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
About
- Provides a MSTest base class for tests.
- Extends
TestMethodwith retry capability and graceful failure.
How to Use
TestsBase
Provides a TestContext and various helpers to read/write test files.
Example
[TestClass]
public sealed class ExampleTests : TestsBase
{
[TestMethod]
public void ExampleTest()
{
// Your test logic here.
}
}
TestMethodEx
RetryCount
Retries failed tests.
[TestMethodEx(RetryCount = 6), Description("This test will be executed 5 times and succeed.")]
public void RetryUntilPassesTest()
{
int executionCount = this.TestContext.GetProperty<int>("ExecutionCount", 1);
this.TestContext.WriteLine($"Current ExecutionCount: {executionCount:0}");
this.TestContext.SetProperty<int>("ExecutionCount", executionCount + 1);
executionCount.ShouldBe(5);
}
[TestMethodEx(RetryCount = 2), Description("This test will be executed 3 times and fail.")]
public void RetryUntilFailsTest()
{
int executionCount = this.TestContext.GetProperty<int>("ExecutionCount", 1);
this.TestContext.WriteLine($"Current ExecutionCount: {executionCount:0}");
this.TestContext.SetProperty<int>("ExecutionCount", executionCount + 1);
executionCount.ShouldBe(5);
}
RetryDelay
Waits the given amount of time between retries.
[TestMethodEx(RetryCount = 2, RetryDelay = 1_000),
Description("This test will be executed max. 3 times, we will wait 1s in between tries.")]
public void RetryAndWaitTest()
{
// My test...
}
TreatFailedAsInconclusive
If the test fails, it will be treated as Inconclusive.
[TestMethodEx(TreatFailedAsInconclusive = true)]
public void TreatFailedAsInconclusiveTest()
{
Assert.Fail("This test fails, but will be treated as inconclusive.");
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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.
-
net9.0
- MSTest.TestFramework (>= 4.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on fm.Extensions.Testing:
| Package | Downloads |
|---|---|
|
fm.Extensions.Testing.DependencyInjection
Provides a MSTest base class for tests based on IServiceProvider. Use common Startup.cs patterns like ConfigureServices(...), ConfigureConfiguration(...) and ConfigureLogging(...) to setup your tests. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 9.0.0 | 190 | 10/8/2025 |
| 8.2.1 | 269 | 4/22/2025 |
| 8.2.0 | 142 | 4/19/2025 |
| 8.1.0 | 185 | 4/19/2025 |
| 8.0.0 | 185 | 11/15/2024 |
| 7.0.2 | 190 | 7/19/2024 |
| 7.0.1 | 218 | 4/5/2024 |
| 7.0.0 | 185 | 3/27/2024 |
| 6.2.0 | 323 | 11/5/2023 |
| 6.1.0 | 294 | 6/20/2023 |
| 6.0.0 | 375 | 3/4/2023 |
| 5.6.0 | 553 | 9/27/2022 |
| 5.5.0 | 587 | 8/5/2022 |
| 5.4.0 | 892 | 8/12/2021 |
| 5.2.0 | 652 | 3/16/2021 |
| 5.0.1 | 1,154 | 1/9/2020 |
| 5.0.0 | 830 | 9/4/2019 |
| 4.0.0 | 1,523 | 6/28/2018 |
| 3.1.1 | 1,595 | 5/7/2018 |
| 3.1.0 | 1,283 | 1/3/2018 |
| 3.0.0 | 1,255 | 10/9/2017 |
| 2.0.0 | 1,831 | 3/2/2017 |
| 1.1.0 | 2,146 | 6/29/2016 |
| 1.0.0 | 2,494 | 11/27/2015 |
BREAKING: Target MSTest v4