fm.Extensions.Testing
11.0.0
dotnet add package fm.Extensions.Testing --version 11.0.0
NuGet\Install-Package fm.Extensions.Testing -Version 11.0.0
<PackageReference Include="fm.Extensions.Testing" Version="11.0.0" />
<PackageVersion Include="fm.Extensions.Testing" Version="11.0.0" />
<PackageReference Include="fm.Extensions.Testing" />
paket add fm.Extensions.Testing --version 11.0.0
#r "nuget: fm.Extensions.Testing, 11.0.0"
#:package fm.Extensions.Testing@11.0.0
#addin nuget:?package=fm.Extensions.Testing&version=11.0.0
#tool nuget:?package=fm.Extensions.Testing&version=11.0.0
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 | net10.0 is compatible. 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. |
-
net10.0
- MSTest.TestFramework (>= 4.0.2)
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 |
|---|---|---|
| 11.0.0 | 170 | 11/26/2025 |
| 10.0.0 | 287 | 11/13/2025 |
| 9.0.0 | 212 | 10/8/2025 |
| 8.2.1 | 276 | 4/22/2025 |
| 8.2.0 | 150 | 4/19/2025 |
| 8.1.0 | 199 | 4/19/2025 |
| 8.0.0 | 195 | 11/15/2024 |
| 7.0.2 | 200 | 7/19/2024 |
| 7.0.1 | 225 | 4/5/2024 |
| 7.0.0 | 192 | 3/27/2024 |
| 6.2.0 | 325 | 11/5/2023 |
| 6.1.0 | 297 | 6/20/2023 |
| 6.0.0 | 382 | 3/4/2023 |
| 5.6.0 | 562 | 9/27/2022 |
| 5.5.0 | 595 | 8/5/2022 |
| 5.4.0 | 905 | 8/12/2021 |
| 5.2.0 | 672 | 3/16/2021 |
| 5.0.1 | 1,171 | 1/9/2020 |
| 5.0.0 | 849 | 9/4/2019 |
| 4.0.0 | 1,578 | 6/28/2018 |
| 3.1.1 | 1,656 | 5/7/2018 |
| 3.1.0 | 1,319 | 1/3/2018 |
| 3.0.0 | 1,291 | 10/9/2017 |
| 2.0.0 | 1,880 | 3/2/2017 |
| 1.1.0 | 2,219 | 6/29/2016 |
| 1.0.0 | 2,568 | 11/27/2015 |
- BREAKING: `TestContextExtensions.FullyQualifiedTestName` is now an extension property.
- `TestsBase.ReadSourceFromJson<T>(...)`: `T` is no longer `notnull` constrained.