diff --git a/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs b/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs index 602bf672f..08dbe1731 100644 --- a/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs +++ b/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs @@ -1,5 +1,5 @@ -using Atata; using Lombiq.HelpfulLibraries.OrchardCore.Mvc; +using Lombiq.HelpfulLibraries.Refit.Helpers; using Lombiq.Tests.UI.Constants; using Lombiq.Tests.UI.Exceptions; using Lombiq.Tests.UI.Pages; @@ -12,6 +12,7 @@ using OpenQA.Selenium; using OrchardCore.Abstractions.Setup; using OrchardCore.Admin; +using OrchardCore.Data; using OrchardCore.DisplayManagement.Extensions; using OrchardCore.Entities; using OrchardCore.Environment.Extensions; @@ -32,12 +33,11 @@ using OrchardCore.Workflows.Http.Models; using OrchardCore.Workflows.Models; using OrchardCore.Workflows.Services; -using RestEase; +using Refit; using Shouldly; using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Net.Http; @@ -414,16 +414,18 @@ private static IShortcutsApi GetApi(this UITestContext context) => BaseAddress = context.Scope.BaseUri, }; - return RestClient.For(httpClient); + return RefitHelper.WithNewtonsoftJson(httpClient); }); - [SuppressMessage( - "StyleCop.CSharp.DocumentationRules", - "SA1600:Elements should be documented", - Justification = "Just maps to controller actions.")] + /// + /// A client interface for Lombiq.Tests.UI.Shortcuts web APIs. + /// public interface IShortcutsApi { - [Get("api/ApplicationInfo")] + /// + /// Sends a web request to endpoint. + /// + [Get("/api/ApplicationInfo")] Task GetApplicationInfoFromApiAsync(); } @@ -478,7 +480,7 @@ public static async Task CreateAndSwitchToTenantAsync( { setupParameters ??= new OrchardCoreSetupParameters(context); var databaseProvider = setupParameters.DatabaseProvider == OrchardCoreSetupPage.DatabaseType.SqlServer - ? OrchardCore.Data.DatabaseProviderValue.SqlConnection + ? DatabaseProviderValue.SqlConnection : setupParameters.DatabaseProvider.ToString(); await context.Application.UsingScopeAsync( diff --git a/Lombiq.Tests.UI/Lombiq.Tests.UI.csproj b/Lombiq.Tests.UI/Lombiq.Tests.UI.csproj index 7c7661297..3ce48884e 100644 --- a/Lombiq.Tests.UI/Lombiq.Tests.UI.csproj +++ b/Lombiq.Tests.UI/Lombiq.Tests.UI.csproj @@ -66,6 +66,7 @@ + @@ -82,7 +83,7 @@ - + @@ -92,7 +93,7 @@ - +