public void ConfigureOptionsRegistersClassAsIValidatableIntoDiContainer() { IConfiguration cfg = new ConfigurationBuilder().Build(); var services = new ServiceCollection(); services.ConfigureOptions <ValidatableTestSettings>(cfg); ServiceProvider provider = services.BuildServiceProvider(); IValidatable settings = provider.GetRequiredService <IValidatable>(); settings.Should().NotBeNull(); settings.Should().BeOfType <ValidatableTestSettings>(); }