mirror of
https://github.com/sphildreth/roadie
synced 2024-11-14 00:17:12 +00:00
44 lines
No EOL
1.1 KiB
C#
44 lines
No EOL
1.1 KiB
C#
using Microsoft.Extensions.Configuration;
|
|
using Roadie.Library.Configuration;
|
|
using Xunit;
|
|
|
|
namespace Roadie.Library.Tests
|
|
{
|
|
public class ConfigurationTests
|
|
{
|
|
public static IConfiguration InitConfiguration()
|
|
{
|
|
var config = new ConfigurationBuilder()
|
|
.AddJsonFile("appsettings.test.json")
|
|
.Build();
|
|
return config;
|
|
}
|
|
|
|
private readonly IRoadieSettings _settings;
|
|
|
|
private readonly IConfiguration _configuration;
|
|
|
|
private IRoadieSettings Settings
|
|
{
|
|
get
|
|
{
|
|
return _settings;
|
|
}
|
|
}
|
|
|
|
public ConfigurationTests()
|
|
{
|
|
_configuration = InitConfiguration();
|
|
_settings = new RoadieSettings();
|
|
_configuration.GetSection("RoadieSettings").Bind(_settings);
|
|
}
|
|
|
|
[Fact]
|
|
public void LoadRootLevelConfiguration()
|
|
{
|
|
var inboundFolder = @"C:\roadie_dev_root\inbound";
|
|
var configInboundFolder = Settings.InboundFolder;
|
|
Assert.Equal(inboundFolder, configInboundFolder);
|
|
}
|
|
}
|
|
} |