From 4c5cc37bd71a2e85d6965f8ddf87a6f6b19fe852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Sat, 11 Nov 2023 12:12:09 +0100 Subject: [PATCH 1/2] Add EnableAutoSetupIfNotUITesting extension method. --- .../Extensions/OrchardCoreBuilderExtensions.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Lombiq.Tests.UI.AppExtensions/Extensions/OrchardCoreBuilderExtensions.cs diff --git a/Lombiq.Tests.UI.AppExtensions/Extensions/OrchardCoreBuilderExtensions.cs b/Lombiq.Tests.UI.AppExtensions/Extensions/OrchardCoreBuilderExtensions.cs new file mode 100644 index 000000000..bcf47a3e7 --- /dev/null +++ b/Lombiq.Tests.UI.AppExtensions/Extensions/OrchardCoreBuilderExtensions.cs @@ -0,0 +1,13 @@ +using Microsoft.Extensions.Configuration; + +namespace Microsoft.Extensions.DependencyInjection; + +public static class OrchardCoreBuilderExtensions +{ + public static OrchardCoreBuilder EnableAutoSetupIfNotUITesting( + this OrchardCoreBuilder orchardCoreBuilder, + IConfiguration configuration) => + !configuration.IsUITesting() + ? orchardCoreBuilder.AddSetupFeatures("OrchardCore.AutoSetup") + : orchardCoreBuilder; +} From e3e29ce40133d8cb50ecc01041df690308771df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Mon, 13 Nov 2023 17:06:35 +0100 Subject: [PATCH 2/2] Add xmldoc. --- .../Extensions/OrchardCoreBuilderExtensions.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lombiq.Tests.UI.AppExtensions/Extensions/OrchardCoreBuilderExtensions.cs b/Lombiq.Tests.UI.AppExtensions/Extensions/OrchardCoreBuilderExtensions.cs index bcf47a3e7..4752c52d5 100644 --- a/Lombiq.Tests.UI.AppExtensions/Extensions/OrchardCoreBuilderExtensions.cs +++ b/Lombiq.Tests.UI.AppExtensions/Extensions/OrchardCoreBuilderExtensions.cs @@ -4,6 +4,10 @@ namespace Microsoft.Extensions.DependencyInjection; public static class OrchardCoreBuilderExtensions { + /// + /// Enables the OrchardCore.AutoSetup feature if the doesn't indicate UI + /// testing. + /// public static OrchardCoreBuilder EnableAutoSetupIfNotUITesting( this OrchardCoreBuilder orchardCoreBuilder, IConfiguration configuration) =>