Changed default test setting to Boot=false

Signed-off-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Bjarke Berg
2020-10-16 07:08:50 +02:00
parent b27732adc8
commit d74ec6e130
2 changed files with 7 additions and 7 deletions

View File

@@ -50,7 +50,7 @@ namespace Umbraco.Tests.Testing
/// </summary>
/// <remarks>Default is to use the global tests plugin manager.</remarks>
public UmbracoTestOptions.TypeLoader TypeLoader { get => _typeLoader.ValueOrDefault(UmbracoTestOptions.TypeLoader.Default); set => _typeLoader.Set(value); }
public bool Boot { get => _boot.ValueOrDefault(true); set => _boot.Set(value); }
public bool Boot { get => _boot.ValueOrDefault(false); set => _boot.Set(value); }
private readonly Settable<bool> _boot = new Settable<bool>();

View File

@@ -92,7 +92,8 @@ namespace Umbraco.Tests.Integration.Testing
var host = hostBuilder.StartAsync().GetAwaiter().GetResult();
Services = host.Services;
var app = new ApplicationBuilder(host.Services);
Configure(app);
Configure(app); //Takes around 200 ms
OnFixtureTearDown(() => host.Dispose());
}
@@ -274,14 +275,13 @@ namespace Umbraco.Tests.Integration.Testing
public virtual void Configure(IApplicationBuilder app)
{
Services.GetRequiredService<IBackofficeSecurityFactory>().EnsureBackofficeSecurity();
Services.GetRequiredService<IUmbracoContextFactory>().EnsureUmbracoContext();
// get the currently set options
//get the currently set options
var testOptions = TestOptionAttributeBase.GetTestOptions<UmbracoTestAttribute>();
if (testOptions.Boot)
{
app.UseUmbracoCore();
Services.GetRequiredService<IBackofficeSecurityFactory>().EnsureBackofficeSecurity();
Services.GetRequiredService<IUmbracoContextFactory>().EnsureUmbracoContext();
app.UseUmbracoCore(); // Takes 200 ms
}
}