fm.Extensions.Configuration.TestContext
10.0.1
dotnet add package fm.Extensions.Configuration.TestContext --version 10.0.1
NuGet\Install-Package fm.Extensions.Configuration.TestContext -Version 10.0.1
<PackageReference Include="fm.Extensions.Configuration.TestContext" Version="10.0.1" />
<PackageVersion Include="fm.Extensions.Configuration.TestContext" Version="10.0.1" />
<PackageReference Include="fm.Extensions.Configuration.TestContext" />
paket add fm.Extensions.Configuration.TestContext --version 10.0.1
#r "nuget: fm.Extensions.Configuration.TestContext, 10.0.1"
#:package fm.Extensions.Configuration.TestContext@10.0.1
#addin nuget:?package=fm.Extensions.Configuration.TestContext&version=10.0.1
#tool nuget:?package=fm.Extensions.Configuration.TestContext&version=10.0.1
About
Provides a MSTest TestContext configuration provider implementation for Microsoft.Extensions.Configuration.
How to Use
[TestClass]
public sealed class ExampleTests : ServiceTestsBase // Provided by fm.Extensions.Testing.DependencyInjection
{
protected override void ConfigureConfiguration(IConfigurationBuilder configuration)
{
base.ConfigureConfiguration(configuration);
// Add TestContext properties as configuration.
configuration.AddTestContext(this.TestContext);
}
[TestMethod]
public void ExampleTest()
{
// Assuming your .runsettings file looks like this:
//
// <?xml version="1.0" encoding="utf-8"?>
// <RunSettings>
// <TestRunParameters>
// <Parameter name="Logging:LogLevel:Default" value="Information"/>
// <Parameter name="Logging:LogLevel:System" value="Warning"/>
// <Parameter name="Logging:LogLevel:Microsoft" value="Warning"/>
// </TestRunParameters>
// </RunSettings>
this.Configuration.GetValue<LogLevel>("Logging:LogLevel:Default").ShouldBe(LogLevel.Information);
}
}
Main Types
The main types provided by this library are:
TestContextConfigurationExtensions
Related Packages
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Microsoft.Extensions.Configuration (>= 11.0.0)
- MSTest.TestFramework (>= 4.5.3)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on fm.Extensions.Configuration.TestContext:
| Package | Downloads |
|---|---|
|
fm.Extensions.Testing.DependencyInjection
Provides an MSTest base class for tests based on IServiceProvider. Use common Startup.cs patterns like ConfigureServices(...), ConfigureConfiguration(...) and ConfigureLogging(...) to set up your tests. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.1 | 0 | 11/25/2026 |
| 10.0.0 | 129 | 11/12/2026 |
| 9.0.0 | 608 | 11/13/2025 |
| 8.0.0 | 280 | 10/8/2025 |
| 7.0.0 | 559 | 11/15/2024 |
| 6.0.1 | 1,260 | 4/5/2024 |
| 6.0.0 | 8,524 | 3/27/2024 |
| 5.0.0 | 5,612 | 3/4/2023 |
| 4.3.0 | 9,657 | 8/5/2022 |
| 4.2.0 | 4,284 | 11/11/2021 |
| 4.1.0 | 3,897 | 8/11/2021 |
| 4.0.0 | 2,321 | 11/15/2020 |
| 3.2.0 | 2,110 | 1/1/2020 |
| 3.1.0 | 1,823 | 10/23/2019 |
| 3.0.0 | 1,880 | 9/4/2019 |
| 2.0.0 | 12,330 | 10/9/2017 |
- BREAKING: Target .NET 11
- Use runtime-async - https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-11/runtime#runtime-async