24 lines
658 B
C#
24 lines
658 B
C#
using Microsoft.Extensions.Configuration;
|
|
|
|
namespace AyCode.Core.Tests;
|
|
|
|
public abstract class TestModelBase
|
|
{
|
|
protected IConfiguration AppSettingsConfiguration;
|
|
|
|
protected TestModelBase()
|
|
{
|
|
//if (IsProductVersion) throw new Exception("IsProductVersion!!!!!");
|
|
|
|
AppSettingsConfiguration = InitAppSettingsConfiguration();
|
|
}
|
|
|
|
protected IConfiguration InitAppSettingsConfiguration(string appSettingsFileName = "appsettings.json")
|
|
{
|
|
var config = new ConfigurationBuilder()
|
|
.AddJsonFile(appSettingsFileName)
|
|
.AddEnvironmentVariables()
|
|
.Build();
|
|
return config;
|
|
}
|
|
} |