fm.Extensions.Configuration.TestContext
4.0.0
MSTest TestContext configuration provider implementation for Microsoft.Extensions.Configuration.
Install-Package fm.Extensions.Configuration.TestContext -Version 4.0.0
dotnet add package fm.Extensions.Configuration.TestContext --version 4.0.0
<PackageReference Include="fm.Extensions.Configuration.TestContext" Version="4.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add fm.Extensions.Configuration.TestContext --version 4.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: fm.Extensions.Configuration.TestContext, 4.0.0"
For F# scripts that support #r syntax, copy this into the source code to reference the package.
Release Notes
Upgrade to .NET 5.0
Dependencies
-
.NETFramework 4.6.1
- Microsoft.Extensions.Configuration (>= 5.0.0)
- MSTest.TestFramework (>= 2.1.2)
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration (>= 5.0.0)
- MSTest.TestFramework (>= 2.1.2)
Used By
NuGet packages (1)
Showing the top 1 NuGet packages that depend on fm.Extensions.Configuration.TestContext:
Package | Downloads |
---|---|
fm.Extensions.Testing.DependencyInjection.MSTest
Provides a MSTest base class for tests based on Microsoft.Extensions.DependencyInjection. Use common Startup.cs patterns like ConfigureServices(...) and Configure(...) to setup your tests.
This extends ServiceTestsBase by adding the TestContext properties to configuration and enabling TestContext logging.
Commonly used types:
ServiceTests
Examples see https://www.nuget.org/packages/fm.Extensions.Testing.DependencyInjection
[TestClass]
public sealed class ExampleTests : ServiceTests
{
protected override void ConfigureConfiguration([NotNull] IConfigurationBuilder configuration)
{
base.ConfigureConfiguration(configuration);
// Add additional configuration here
configuration.AddInMemoryCollection(new[]
{
new KeyValuePair<string, string>("ConfigKey", "ConfigValue"),
});
}
protected override void ConfigureLogging([NotNull] ILoggingBuilder builder)
{
base.ConfigureLogging(builder);
// Add additional loggers or configuration
builder.AddFilter(logLevel => true);
}
protected override void ConfigureServices([NotNull] IServiceCollection services)
{
base.ConfigureServices(services);
// Configure your services here
// services.AddSingleton<IMyService, MyService>();
}
[TestMethod]
public void ExampleTest()
{
// Use your DI container as you would during runtime
// IMyService service = this.GetRequiredService<IMyService>();
}
}
|
GitHub repositories
This package is not used by any popular GitHub repositories.