Switch ConfigureServices back to protected.
Downstream users may wish to subclass and add their application specific services.
This commit is contained in:
@@ -80,7 +80,7 @@ namespace Umbraco.Cms.Tests.Integration.Testing
|
||||
.ConfigureServices((_, services) =>
|
||||
{
|
||||
ConfigureServices(services);
|
||||
ConfigureTestSpecificServices(services);
|
||||
ConfigureTestServices(services);
|
||||
|
||||
if (!TestOptions.Boot)
|
||||
{
|
||||
@@ -93,7 +93,7 @@ namespace Umbraco.Cms.Tests.Integration.Testing
|
||||
return hostBuilder;
|
||||
}
|
||||
|
||||
private void ConfigureServices(IServiceCollection services)
|
||||
protected void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddUnique(CreateLoggerFactory());
|
||||
services.AddSingleton(TestHelper.DbProviderFactoryCreator);
|
||||
@@ -143,10 +143,23 @@ namespace Umbraco.Cms.Tests.Integration.Testing
|
||||
builder.Build();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hook for altering UmbracoBuilder setup
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Can also be used for registering test doubles.
|
||||
/// </remarks>
|
||||
protected virtual void CustomTestSetup(IUmbracoBuilder builder)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hook for registering test doubles.
|
||||
/// </summary>
|
||||
protected virtual void ConfigureTestServices(IServiceCollection services)
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual T GetRequiredService<T>() => Services.GetRequiredService<T>();
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -107,10 +107,6 @@ public abstract class UmbracoIntegrationTestBase
|
||||
return NullLoggerFactory.Instance;
|
||||
}
|
||||
|
||||
protected virtual void ConfigureTestSpecificServices(IServiceCollection services)
|
||||
{
|
||||
}
|
||||
|
||||
protected void UseTestDatabase(IApplicationBuilder app)
|
||||
=> UseTestDatabase(app.ApplicationServices);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user