Skip to content

Commit

Permalink
Turning AssertAppLogsWithIdleCheckAsync() into an extension method
Browse files Browse the repository at this point in the history
  • Loading branch information
Piedone committed Jul 9, 2024
1 parent 92b7261 commit 131b894
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Services;
using Shouldly;
using System;
using System.Threading.Tasks;
using static Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.Constants.IdleTenantData;

namespace Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.Extensions;

public static class IdleTenantManagementExtensions
{
public static void SetMaxIdleMinutesAndLoggingForUITest(
this OrchardCoreUITestExecutorConfiguration configuration) => configuration.OrchardCoreConfiguration.BeforeAppStart +=
public static void SetMaxIdleMinutesAndLoggingForUITest(this OrchardCoreUITestExecutorConfiguration configuration) =>
configuration.OrchardCoreConfiguration.BeforeAppStart +=
(_, argumentsBuilder) =>
{
argumentsBuilder
Expand All @@ -24,8 +23,7 @@ public static void SetMaxIdleMinutesAndLoggingForUITest(
return Task.CompletedTask;
};

public static readonly Func<IWebApplicationInstance, Task> AssertAppLogsWithIdleCheckAsync =
async webApplicationInstance =>
public static async Task AssertAppLogsWithIdleCheckAsync(this IWebApplicationInstance webApplicationInstance) =>
(await webApplicationInstance.GetLogOutputAsync())
.ShouldContain($"Shutting down tenant \"{IdleTenantName}\" because of idle timeout.");
}

0 comments on commit 131b894

Please sign in to comment.