fm.Extensions.Testing
8.2.0
See the version list below for details.
dotnet add package fm.Extensions.Testing --version 8.2.0
NuGet\Install-Package fm.Extensions.Testing -Version 8.2.0
<PackageReference Include="fm.Extensions.Testing" Version="8.2.0" />
<PackageVersion Include="fm.Extensions.Testing" Version="8.2.0" />
<PackageReference Include="fm.Extensions.Testing" />
paket add fm.Extensions.Testing --version 8.2.0
#r "nuget: fm.Extensions.Testing, 8.2.0"
#:package fm.Extensions.Testing@8.2.0
#addin nuget:?package=fm.Extensions.Testing&version=8.2.0
#tool nuget:?package=fm.Extensions.Testing&version=8.2.0
fm.Extensions.Testing
- Provides a MSTest base class for tests.
- Extends
TestMethod
with retry capability and graceful failure.
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.Log.LogInformation("Current ExecutionCount: {property}", executionCount);
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.Log.LogInformation("Current ExecutionCount: {property}", executionCount);
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()
{
// My test...
}
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. |
-
net9.0
- MSTest.TestFramework (>= 3.8.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on fm.Extensions.Testing:
Package | Downloads |
---|---|
fm.Extensions.Testing.DependencyInjection
Provides a base class for tests based on Microsoft.Extensions.DependencyInjection. Use common Startup.cs patterns like ConfigureConfiguration(...), ConfigureServices(...) and Configure(...) to setup your tests. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
8.2.1 | 193 | 4/22/2025 |
8.2.0 | 108 | 4/19/2025 |
8.1.0 | 109 | 4/19/2025 |
8.0.0 | 147 | 11/15/2024 |
7.0.2 | 155 | 7/19/2024 |
7.0.1 | 182 | 4/5/2024 |
7.0.0 | 147 | 3/27/2024 |
6.2.0 | 291 | 11/5/2023 |
6.1.0 | 239 | 6/20/2023 |
6.0.0 | 315 | 3/4/2023 |
5.6.0 | 491 | 9/27/2022 |
5.5.0 | 526 | 8/5/2022 |
5.4.0 | 812 | 8/12/2021 |
5.2.0 | 581 | 3/16/2021 |
5.0.1 | 1,082 | 1/9/2020 |
5.0.0 | 756 | 9/4/2019 |
4.0.0 | 1,364 | 6/28/2018 |
3.1.1 | 1,435 | 5/7/2018 |
3.1.0 | 1,169 | 1/3/2018 |
3.0.0 | 1,140 | 10/9/2017 |
2.0.0 | 1,671 | 3/2/2017 |
1.1.0 | 1,925 | 6/29/2016 |
1.0.0 | 2,291 | 11/27/2015 |
Migrate the features of 'fm.Extensions.Testing.MSTest' into this project.