Fhi.BaseConfigTests
0.9.0
See the version list below for details.
dotnet add package Fhi.BaseConfigTests --version 0.9.0
NuGet\Install-Package Fhi.BaseConfigTests -Version 0.9.0
<PackageReference Include="Fhi.BaseConfigTests" Version="0.9.0" />
paket add Fhi.BaseConfigTests --version 0.9.0
#r "nuget: Fhi.BaseConfigTests, 0.9.0"
// Install Fhi.BaseConfigTests as a Cake Addin #addin nuget:?package=Fhi.BaseConfigTests&version=0.9.0 // Install Fhi.BaseConfigTests as a Cake Tool #tool nuget:?package=Fhi.BaseConfigTests&version=0.9.0
Usage of BaseConfigTests
This is a base class for use when testing configurations, or when your tests needs to load configurations.
Your test class should derive from the baseclass.
By default it knows about the appsettings.json
, the other sub-appsettings, like appsettings.development.json
or whatever you prefer to call them, you need to set in your derived class.
The baseclass will load the settings as specified, and you can extract the section you need using a built-in utility method.
It depends on NUnit, which is used underneath.
Usage
public class MyTest : BaseConfigTests
{
public MyTest() : base("appsettings.development.json")
{
}
[Test]
public void Test()
{
var section = GetSection<MySection>(nameof(MySection));
Assert.That(section, Is.Not.Null);
Assert.That(section.MyProperty, Is.EqualTo("MyValue"));
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Microsoft.Extensions.Configuration (>= 6.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Configuration.FileExtensions (>= 6.0.0)
- Microsoft.Extensions.Configuration.Json (>= 6.0.0)
- nunit (>= 3.13.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.0 | 221 | 11/18/2024 |
1.0.0-beta.3 | 3,981 | 10/9/2023 |
1.0.0-beta.2 | 730 | 8/19/2023 |
1.0.0-beta.1 | 88 | 8/19/2023 |
0.9.1 | 1,360 | 11/30/2022 |
0.9.0 | 209 | 11/30/2022 |