Fhi.ClientCredentials.TestSupport
2.0.0-beta1
See the version list below for details.
dotnet add package Fhi.ClientCredentials.TestSupport --version 2.0.0-beta1
NuGet\Install-Package Fhi.ClientCredentials.TestSupport -Version 2.0.0-beta1
<PackageReference Include="Fhi.ClientCredentials.TestSupport" Version="2.0.0-beta1" />
paket add Fhi.ClientCredentials.TestSupport --version 2.0.0-beta1
#r "nuget: Fhi.ClientCredentials.TestSupport, 2.0.0-beta1"
// Install Fhi.ClientCredentials.TestSupport as a Cake Addin #addin nuget:?package=Fhi.ClientCredentials.TestSupport&version=2.0.0-beta1&prerelease // Install Fhi.ClientCredentials.TestSupport as a Cake Tool #tool nuget:?package=Fhi.ClientCredentials.TestSupport&version=2.0.0-beta1&prerelease
Fhi.ClientCredentials.TestSupport
This package contains tests that checks your appsettings.*.json files for correct configuration of the ClientCredentials package. It checks that your settings for test and production are different, and that all your different test and dev projects uses the same settings.
The assumption here is that your production use a production based STS (Secure Token Service), wheres the other enviornments all use the same Test STS.
The package has a default STS of the NHN HelseId STS. This can be changed by overriden the STS properties in the main class, see below for details.
Usage
Include the package in your test project.
<ItemGroup>
<PackageReference Include="Fhi.ClientCredentials.TestSupport" Version="1.0.0-beta.1" />
</ItemGroup>
Add the following test class to your project. In the base part of the constructor, list the differerent environments you have appsettings for, and for which there exists an appsettings.XXX.json
file.
public class ClientConsistencyTests : Fhi.ClientCredentials.TestSupport.ClientCredentialKeyPairsConfigConsistencyTests
{
public ClientConsistencyTests() : base(new List<string> { "QA", "AzureDev", "Test", "Development" },SetupBaseConfigTests.AppSettingsUsage.AppSettingsIsBaseOnly)
{
}
}
The different alternatives for the second base parameter, AppSettingsUsage is as follows:
public enum AppSettingsUsage
{
AppSettingsIsProd, // appsettings.prod exist and is merged with appsettings.json
AppSettingsIsBaseOnly, // No seperate prod exist, appsettings.json is production, but when anything else is specified, merge is to happen
AppSettingsIsTestWhenDev, // When developing, appsettings is development, require seperate prod
AppSettingsIsExplicit // Use only the specified appsettings.
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
-
net8.0
- Fhi.ClientCredentialsKeypairs (>= 3.0.0-beta1)
- Microsoft.Extensions.Configuration.Json (>= 8.0.1)
- NUnit (>= 4.2.2)
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 | 71 | 11/26/2024 |
2.0.0-beta2 | 38 | 11/26/2024 |
1.0.0-beta.6 | 4,156 | 10/9/2023 |
1.0.0-beta.5 | 737 | 8/19/2023 |
1.0.0-beta.4 | 692 | 3/8/2023 |
1.0.0-beta.1 | 177 | 3/7/2023 |