using Microsoft.Extensions.Configuration;
using System.Collections.Generic;
using System.IO;

namespace Knoks.Test.Integrations
{
    internal class Config
    {
        public static readonly IConfigurationRoot Root;
        public static readonly string DefaultDbConnection;
		public static readonly IDictionary<string, string> DbConnections;

		static Config()
        {
            Root = new ConfigurationBuilder()
                .SetBasePath(Directory.GetCurrentDirectory())
                .AddJsonFile("appsettings.json", false)
                .Build();

			DefaultDbConnection = Root.GetValue<string>("DbConnections:Knoks_Main");
			DbConnections = new Dictionary<string, string> { ["Knoks_Main"] = DefaultDbConnection };
		}
    }
}