Пример #1
0
        protected override IHostBuilder?CreateHostBuilder()
        {
            var host = new Utilities.Hosting.Host("ess-tests");

            return(host.CreateHost("EMBC").ConfigureHostConfiguration(opts =>
            {
                // add secerts from host assembly
                opts.AddUserSecrets(Assembly.LoadFile($"{Environment.CurrentDirectory}/EMBC.ESS.Host.dll"), false, true);
                opts.AddJsonFile("appsettings.json", false).AddJsonFile("appsettings.Development.json", true);
            }));
        }
Пример #2
0
        protected override IHostBuilder?CreateHostBuilder()
        {
            var host = new Utilities.Hosting.Host("ess-tests");

            return(host.CreateHost("EMBC").ConfigureHostConfiguration(opts =>
            {
                // add secerts from host assembly
                opts.AddUserSecrets(Assembly.LoadFile($"{Environment.CurrentDirectory}/EMBC.ESS.Host.dll"), false, true);
                opts.AddJsonFile("appsettings.json", false).AddJsonFile("appsettings.Development.json", true);
                // disable background tasks during tests
                opts.AddInMemoryCollection(new[] { new KeyValuePair <string, string>("backgroundTask:enabled", "false") });
            }));
        }