fm.Extensions.Configuration.TestContext
8.0.0
dotnet add package fm.Extensions.Configuration.TestContext --version 8.0.0
NuGet\Install-Package fm.Extensions.Configuration.TestContext -Version 8.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.Configuration.TestContext" Version="8.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="fm.Extensions.Configuration.TestContext" Version="8.0.0" />
<PackageReference Include="fm.Extensions.Configuration.TestContext" />
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.Configuration.TestContext --version 8.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: fm.Extensions.Configuration.TestContext, 8.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.Configuration.TestContext@8.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.Configuration.TestContext&version=8.0.0
#tool nuget:?package=fm.Extensions.Configuration.TestContext&version=8.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | 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
- Microsoft.Extensions.Configuration (>= 9.0.9)
- MSTest.TestFramework (>= 4.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on fm.Extensions.Configuration.TestContext:
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 |
---|---|---|
8.0.0 | 163 | 10/8/2025 |
7.0.0 | 426 | 11/15/2024 |
6.0.1 | 1,103 | 4/5/2024 |
6.0.0 | 4,395 | 3/27/2024 |
5.0.0 | 4,413 | 3/4/2023 |
4.3.0 | 8,489 | 8/5/2022 |
4.2.0 | 3,772 | 11/11/2021 |
4.1.0 | 2,932 | 8/11/2021 |
4.0.0 | 2,191 | 11/15/2020 |
3.2.0 | 1,993 | 1/1/2020 |
3.1.0 | 1,709 | 10/23/2019 |
3.0.0 | 1,766 | 9/4/2019 |
2.0.0 | 12,157 | 10/9/2017 |
1.0.0 | 1,848 | 2/26/2017 |
BREAKING: Target MSTest v4