public void should_register_the_necessary_services() { var serviceCollection = new ServiceCollection(); ConfigureServicesModule.ConfigureServices(services: serviceCollection); Assert.IsTrue(serviceCollection.Any(x => x.ServiceType == typeof(IFAMSScheduleFactory))); Assert.IsTrue(serviceCollection.Any(x => x.ServiceType == typeof(IJobTrigger))); }
public static void ConfigureServices(IServiceCollection services) { var environmentName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); var builder = new ConfigurationBuilder() .AddJsonFile($"appsettings.json", true, true) .AddJsonFile($"appsettings.{environmentName}.json", true, true) .AddEnvironmentVariables(); IConfiguration configuration = builder.Build(); ConfigureServicesModule.ConfigureServices(services, configuration); }