Adds option pattern for smart config
This commit is contained in:
parent
6839cd82e2
commit
f4f2fc47b1
6 changed files with 130 additions and 87 deletions
|
|
@ -7,6 +7,7 @@ using Autofac;
|
|||
using System.Data;
|
||||
using Insight.Database;
|
||||
using Npgsql;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace Tests.ConfigurationTests
|
||||
{
|
||||
|
|
@ -14,6 +15,17 @@ namespace Tests.ConfigurationTests
|
|||
public class SmartConfigProviderTests : TestFixture
|
||||
{
|
||||
|
||||
[TestMethod]
|
||||
public void TrySmartConfigWithOptionsForPostgres()
|
||||
{
|
||||
var config = new ConfigurationBuilder()
|
||||
.AddJsonFile("appconfiguration.dev.json")
|
||||
.AddSmartConfig(options => options.UsePostgres("DefaultConnection"))
|
||||
.Build();
|
||||
|
||||
var actualFeature = config.Get<bool>("Database:UseSSL");
|
||||
|
||||
}
|
||||
[TestMethod]
|
||||
public void Get_ShouldReturnCorrectValueAsBool()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue