示例#1
0
        static SliceFixture()
        {
            Environment.SetEnvironmentVariable(ModuleConfiguration.EnvironmentConfigurationKey, "moduletest");
            Configuration = ModuleConfiguration.CreateConfiguration();
            Configuration.Environment.Should().Be("moduletest");
            //overrideConfiguration?.Invoke(Configuration);

            var builder = new ConfigurationBuilder()
                          .SetBasePath(Directory.GetCurrentDirectory())
                          .AddJsonFile("appsettings.json", true, true)
                          .AddEnvironmentVariables();

            _configuration = builder.Build();

            var startup  = new Startup(_configuration);
            var services = new ServiceCollection();

            startup.ConfigureServices(services);
            var provider = services.BuildServiceProvider();

            _scopeFactory = provider.GetService <IServiceScopeFactory>();
            _checkpoint   = new Checkpoint();
        }