From e312dba3c82d7390e6fda36883b578cb71f0e077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Wed, 20 Nov 2024 19:26:09 +0100 Subject: [PATCH 1/8] Rename ShiftTimeClock to TimeShifterClock. --- Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs | 2 +- .../{ShiftTimeController.cs => TimeShiftController.cs} | 4 ++-- .../Services/{ShiftTimeClock.cs => TimeShifterClock.cs} | 8 ++++---- Lombiq.Tests.UI.Shortcuts/Startup.cs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename Lombiq.Tests.UI.Shortcuts/Controllers/{ShiftTimeController.cs => TimeShiftController.cs} (88%) rename Lombiq.Tests.UI.Shortcuts/Services/{ShiftTimeClock.cs => TimeShifterClock.cs} (87%) diff --git a/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs b/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs index bafbc05c4..390f234a8 100644 --- a/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs +++ b/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs @@ -11,8 +11,8 @@ namespace Lombiq.Tests.UI.Samples.Tests; // When you enable the "Shift Time - Shortcuts - Lombiq UI Testing Toolbox" feature, it replaces Orchard Core's stock -// ICLock implementation with the custom ShiftTimeClock class. You can use the // ~/Lombiq.Tests.UI.Samples/ShiftTime/Set?days=... action to update the ShiftTimeClock.Shift property for the current +// ICLock implementation with the custom TimeShifterClock class. You can use the // tenant, which will trick any service that uses IClock into thinking you are in the future. This can be used to test // features that can expire, such as a limited-time product discount in a web store, without having to wait. public class ShiftTimeTests : UITestBase diff --git a/Lombiq.Tests.UI.Shortcuts/Controllers/ShiftTimeController.cs b/Lombiq.Tests.UI.Shortcuts/Controllers/TimeShiftController.cs similarity index 88% rename from Lombiq.Tests.UI.Shortcuts/Controllers/ShiftTimeController.cs rename to Lombiq.Tests.UI.Shortcuts/Controllers/TimeShiftController.cs index 631b524b1..2b2869c8a 100644 --- a/Lombiq.Tests.UI.Shortcuts/Controllers/ShiftTimeController.cs +++ b/Lombiq.Tests.UI.Shortcuts/Controllers/TimeShiftController.cs @@ -20,7 +20,7 @@ public IActionResult Add(double days, double seconds) => SetInner(current => current + TimeSpan.FromDays(days) + TimeSpan.FromSeconds(seconds)); private IActionResult SetInner(Func edit) => - ShiftTimeClock.UpdateClock(_clock, edit) is { } totalSeconds + TimeShifterClock.UpdateClock(_clock, edit) is { } totalSeconds ? Ok(totalSeconds) - : BadRequest($"The clock is {_clock.GetType().FullName} instead of {nameof(ShiftTimeClock)}."); + : BadRequest($"The clock is {_clock.GetType().FullName} instead of {nameof(TimeShifterClock)}."); } diff --git a/Lombiq.Tests.UI.Shortcuts/Services/ShiftTimeClock.cs b/Lombiq.Tests.UI.Shortcuts/Services/TimeShifterClock.cs similarity index 87% rename from Lombiq.Tests.UI.Shortcuts/Services/ShiftTimeClock.cs rename to Lombiq.Tests.UI.Shortcuts/Services/TimeShifterClock.cs index d7e273a3e..90b143c7e 100644 --- a/Lombiq.Tests.UI.Shortcuts/Services/ShiftTimeClock.cs +++ b/Lombiq.Tests.UI.Shortcuts/Services/TimeShifterClock.cs @@ -10,7 +10,7 @@ namespace Lombiq.Tests.UI.Shortcuts.Services; /// cref="IClock"/> into believing it's the future or past. This service is registered as singleton, so setting will persist in the tenant across requests. /// -public class ShiftTimeClock : IClock +public class TimeShifterClock : IClock { private readonly Clock _inner = new(); @@ -34,16 +34,16 @@ public DateTimeOffset ConvertToTimeZone(DateTimeOffset dateTimeOffset, ITimeZone /// Use this to safely update the value. /// /// - /// The injected service, if it's then its property is updated. + /// The injected service, if it's then its property is updated. /// /// Input is the current value of , output is the new value. /// /// The total seconds of the new value of , or if - /// is not . + /// is not . /// public static double? UpdateClock(IClock clock, Func edit) { - if (clock is not ShiftTimeClock shiftTimeClock) return null; + if (clock is not TimeShifterClock shiftTimeClock) return null; shiftTimeClock.Shift = edit(shiftTimeClock.Shift); return shiftTimeClock.Shift.TotalSeconds; diff --git a/Lombiq.Tests.UI.Shortcuts/Startup.cs b/Lombiq.Tests.UI.Shortcuts/Startup.cs index 1e5179e6f..c5fee468f 100644 --- a/Lombiq.Tests.UI.Shortcuts/Startup.cs +++ b/Lombiq.Tests.UI.Shortcuts/Startup.cs @@ -44,6 +44,6 @@ public sealed class SetTimeStartup : StartupBase public override void ConfigureServices(IServiceCollection services) { services.RemoveImplementationsOf(); - services.AddSingleton(); + services.AddSingleton(); } } From f24bc5b0fab359bb45b9520b7667a9a8ea974aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Wed, 20 Nov 2024 19:28:29 +0100 Subject: [PATCH 2/8] Rename ShiftTimeController to TimeShiftController. --- Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs | 2 +- Lombiq.Tests.UI.Shortcuts/Controllers/TimeShiftController.cs | 4 ++-- .../Extensions/ShortcutsUITestContextExtensions.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs b/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs index 390f234a8..275165d37 100644 --- a/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs +++ b/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs @@ -11,8 +11,8 @@ namespace Lombiq.Tests.UI.Samples.Tests; // When you enable the "Shift Time - Shortcuts - Lombiq UI Testing Toolbox" feature, it replaces Orchard Core's stock -// ~/Lombiq.Tests.UI.Samples/ShiftTime/Set?days=... action to update the ShiftTimeClock.Shift property for the current // ICLock implementation with the custom TimeShifterClock class. You can use the +// ~/Lombiq.Tests.UI.Samples/TimeShift/Set?days=... action to update the TimeShifterClock.Shift property for the current // tenant, which will trick any service that uses IClock into thinking you are in the future. This can be used to test // features that can expire, such as a limited-time product discount in a web store, without having to wait. public class ShiftTimeTests : UITestBase diff --git a/Lombiq.Tests.UI.Shortcuts/Controllers/TimeShiftController.cs b/Lombiq.Tests.UI.Shortcuts/Controllers/TimeShiftController.cs index 2b2869c8a..b5d9cad4d 100644 --- a/Lombiq.Tests.UI.Shortcuts/Controllers/TimeShiftController.cs +++ b/Lombiq.Tests.UI.Shortcuts/Controllers/TimeShiftController.cs @@ -7,11 +7,11 @@ namespace Lombiq.Tests.UI.Shortcuts.Controllers; [DevelopmentAndLocalhostOnly] -public class ShiftTimeController : Controller +public class TimeShiftController : Controller { private readonly IClock _clock; - public ShiftTimeController(IClock clock) => _clock = clock; + public TimeShiftController(IClock clock) => _clock = clock; public IActionResult Set(double days, double seconds) => SetInner(_ => TimeSpan.FromDays(days) + TimeSpan.FromSeconds(seconds)); diff --git a/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs b/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs index 375256bcc..a02b08cd1 100644 --- a/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs +++ b/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs @@ -750,7 +750,7 @@ public static Task ExecuteJsonRecipeSiteSettingAsync(this UITestContext conte public static Task SetShiftTimeAsync(this UITestContext context, double days = 0, double seconds = 0) { context.EnsureValidOrchardCoreTenantScope(); - return context.GoToAsync(controller => controller.Set(days, seconds)); + return context.GoToAsync(controller => controller.Set(days, seconds)); } /// @@ -760,7 +760,7 @@ public static Task SetShiftTimeAsync(this UITestContext context, double days = 0 public static Task AddShiftTimeAsync(this UITestContext context, double days = 0, double seconds = 0) { context.EnsureValidOrchardCoreTenantScope(); - return context.GoToAsync(controller => controller.Add(days, seconds)); + return context.GoToAsync(controller => controller.Add(days, seconds)); } /// From 300812784a14d113bdff324b1e798c00f4569c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Wed, 20 Nov 2024 19:34:07 +0100 Subject: [PATCH 3/8] Change the extension methods to use TimeSpan. --- .../Tests/ShiftTimeTests.cs | 2 +- .../ShortcutsUITestContextExtensions.cs | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs b/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs index 275165d37..807298390 100644 --- a/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs +++ b/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs @@ -46,7 +46,7 @@ await context.FillInCodeMirrorEditorWithRetriesAsync( // This extension method navigates to the action which sets the time offset. You can set it in terms of // days or seconds. Both accept fractions and negative values. If both days and seconds are set, they // are added together. - await context.SetShiftTimeAsync(days: 10); + await context.SetShiftTimeAsync(TimeSpan.FromDays(10)); // Let's verify the date! var tenDaysFromNow = await GetNowAsync(context); diff --git a/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs b/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs index a02b08cd1..89591bcfc 100644 --- a/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs +++ b/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs @@ -744,23 +744,25 @@ public static Task ExecuteJsonRecipeSiteSettingAsync(this UITestContext conte public static Task EnableTimeShiftingAsync(this UITestContext context) => context.EnableFeatureDirectlyAsync(ShiftTime); /// - /// Sets the time shift to a specific value. If both and are - /// provided, then the values are added together. + /// Sets the time shift to a specific value. /// - public static Task SetShiftTimeAsync(this UITestContext context, double days = 0, double seconds = 0) + public static Task SetShiftTimeAsync(this UITestContext context, TimeSpan timeSpan) { context.EnsureValidOrchardCoreTenantScope(); - return context.GoToAsync(controller => controller.Set(days, seconds)); + return timeSpan.TotalDays >= 1.0 + ? context.GoToAsync(controller => controller.Set(timeSpan.TotalDays, 0)) + : context.GoToAsync(controller => controller.Set(0, timeSpan.TotalSeconds)); } /// - /// Adds the specified value to the time shift. If both and are - /// provided, then the values for both are added. Negative values are supported as well. + /// Adds the specified value to the time shift. /// - public static Task AddShiftTimeAsync(this UITestContext context, double days = 0, double seconds = 0) + public static Task AddShiftTimeAsync(this UITestContext context, TimeSpan timeSpan) { context.EnsureValidOrchardCoreTenantScope(); - return context.GoToAsync(controller => controller.Add(days, seconds)); + return timeSpan.TotalDays >= 1.0 + ? context.GoToAsync(controller => controller.Add(timeSpan.TotalDays, 0)) + : context.GoToAsync(controller => controller.Add(0, timeSpan.TotalSeconds)); } /// From 4f09a1dbc0fb2cb251bd27cdbc90b5692f88e649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Wed, 20 Nov 2024 19:35:20 +0100 Subject: [PATCH 4/8] Use string interpolation. --- Lombiq.Tests.UI.Shortcuts/ShortcutsFeatureIds.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Lombiq.Tests.UI.Shortcuts/ShortcutsFeatureIds.cs b/Lombiq.Tests.UI.Shortcuts/ShortcutsFeatureIds.cs index c38f31560..1f7532430 100644 --- a/Lombiq.Tests.UI.Shortcuts/ShortcutsFeatureIds.cs +++ b/Lombiq.Tests.UI.Shortcuts/ShortcutsFeatureIds.cs @@ -7,9 +7,9 @@ public static class ShortcutsFeatureIds public const string Area = "Lombiq.Tests.UI.Shortcuts"; public const string Default = Area; - public const string FeatureToggleTestBench = Default + ".FeatureToggleTestBench"; - public const string MediaCachePurge = Default + ".MediaCachePurge"; - public const string ShiftTime = Default + ".ShiftTime"; - public const string Swagger = Default + ".Swagger"; - public const string Workflows = Default + ".Workflows"; + public const string FeatureToggleTestBench = $"{Default}.{nameof(FeatureToggleTestBench)}"; + public const string MediaCachePurge = $"{Default}.{nameof(MediaCachePurge)}"; + public const string ShiftTime = $"{Default}.{nameof(ShiftTime)}"; + public const string Swagger = $"{Default}.{nameof(Swagger)}"; + public const string Workflows = $"{Default}.{nameof(Workflows)}"; } From b28e49d6d7f96d43f893d7ed9f0c8be0cdcd8063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Wed, 20 Nov 2024 19:36:04 +0100 Subject: [PATCH 5/8] Rename param. --- .../ShortcutsUITestContextExtensions.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs b/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs index 89591bcfc..53de816e7 100644 --- a/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs +++ b/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs @@ -746,23 +746,23 @@ public static Task ExecuteJsonRecipeSiteSettingAsync(this UITestContext conte /// /// Sets the time shift to a specific value. /// - public static Task SetShiftTimeAsync(this UITestContext context, TimeSpan timeSpan) + public static Task SetShiftTimeAsync(this UITestContext context, TimeSpan time) { context.EnsureValidOrchardCoreTenantScope(); - return timeSpan.TotalDays >= 1.0 - ? context.GoToAsync(controller => controller.Set(timeSpan.TotalDays, 0)) - : context.GoToAsync(controller => controller.Set(0, timeSpan.TotalSeconds)); + return time.TotalDays >= 1.0 + ? context.GoToAsync(controller => controller.Set(time.TotalDays, 0)) + : context.GoToAsync(controller => controller.Set(0, time.TotalSeconds)); } /// /// Adds the specified value to the time shift. /// - public static Task AddShiftTimeAsync(this UITestContext context, TimeSpan timeSpan) + public static Task AddShiftTimeAsync(this UITestContext context, TimeSpan time) { context.EnsureValidOrchardCoreTenantScope(); - return timeSpan.TotalDays >= 1.0 - ? context.GoToAsync(controller => controller.Add(timeSpan.TotalDays, 0)) - : context.GoToAsync(controller => controller.Add(0, timeSpan.TotalSeconds)); + return time.TotalDays >= 1.0 + ? context.GoToAsync(controller => controller.Add(time.TotalDays, 0)) + : context.GoToAsync(controller => controller.Add(0, time.TotalSeconds)); } /// From 80ce9c3ecf1c1fdb83543bc5ad13ab3d7123f224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Wed, 20 Nov 2024 22:06:01 +0100 Subject: [PATCH 6/8] Rename TimeShifterClock to TimeShiftingClock --- Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs | 4 ++-- .../Controllers/TimeShiftController.cs | 4 ++-- .../{TimeShifterClock.cs => TimeShiftingClock.cs} | 8 ++++---- Lombiq.Tests.UI.Shortcuts/Startup.cs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) rename Lombiq.Tests.UI.Shortcuts/Services/{TimeShifterClock.cs => TimeShiftingClock.cs} (87%) diff --git a/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs b/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs index 807298390..d73941f69 100644 --- a/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs +++ b/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs @@ -11,8 +11,8 @@ namespace Lombiq.Tests.UI.Samples.Tests; // When you enable the "Shift Time - Shortcuts - Lombiq UI Testing Toolbox" feature, it replaces Orchard Core's stock -// ICLock implementation with the custom TimeShifterClock class. You can use the -// ~/Lombiq.Tests.UI.Samples/TimeShift/Set?days=... action to update the TimeShifterClock.Shift property for the current +// ICLock implementation with the custom TimeShiftingClock class. You can use the +// ~/Lombiq.Tests.UI.Samples/TimeShift/Set?days=... action to update the TimeShiftingClock.Shift property for the current // tenant, which will trick any service that uses IClock into thinking you are in the future. This can be used to test // features that can expire, such as a limited-time product discount in a web store, without having to wait. public class ShiftTimeTests : UITestBase diff --git a/Lombiq.Tests.UI.Shortcuts/Controllers/TimeShiftController.cs b/Lombiq.Tests.UI.Shortcuts/Controllers/TimeShiftController.cs index b5d9cad4d..6fe3e6d1a 100644 --- a/Lombiq.Tests.UI.Shortcuts/Controllers/TimeShiftController.cs +++ b/Lombiq.Tests.UI.Shortcuts/Controllers/TimeShiftController.cs @@ -20,7 +20,7 @@ public IActionResult Add(double days, double seconds) => SetInner(current => current + TimeSpan.FromDays(days) + TimeSpan.FromSeconds(seconds)); private IActionResult SetInner(Func edit) => - TimeShifterClock.UpdateClock(_clock, edit) is { } totalSeconds + TimeShiftingClock.UpdateClock(_clock, edit) is { } totalSeconds ? Ok(totalSeconds) - : BadRequest($"The clock is {_clock.GetType().FullName} instead of {nameof(TimeShifterClock)}."); + : BadRequest($"The clock is {_clock.GetType().FullName} instead of {nameof(TimeShiftingClock)}."); } diff --git a/Lombiq.Tests.UI.Shortcuts/Services/TimeShifterClock.cs b/Lombiq.Tests.UI.Shortcuts/Services/TimeShiftingClock.cs similarity index 87% rename from Lombiq.Tests.UI.Shortcuts/Services/TimeShifterClock.cs rename to Lombiq.Tests.UI.Shortcuts/Services/TimeShiftingClock.cs index 90b143c7e..15fda1a41 100644 --- a/Lombiq.Tests.UI.Shortcuts/Services/TimeShifterClock.cs +++ b/Lombiq.Tests.UI.Shortcuts/Services/TimeShiftingClock.cs @@ -10,7 +10,7 @@ namespace Lombiq.Tests.UI.Shortcuts.Services; /// cref="IClock"/> into believing it's the future or past. This service is registered as singleton, so setting will persist in the tenant across requests. /// -public class TimeShifterClock : IClock +public class TimeShiftingClock : IClock { private readonly Clock _inner = new(); @@ -34,16 +34,16 @@ public DateTimeOffset ConvertToTimeZone(DateTimeOffset dateTimeOffset, ITimeZone /// Use this to safely update the value. /// /// - /// The injected service, if it's then its property is updated. + /// The injected service, if it's then its property is updated. /// /// Input is the current value of , output is the new value. /// /// The total seconds of the new value of , or if - /// is not . + /// is not . /// public static double? UpdateClock(IClock clock, Func edit) { - if (clock is not TimeShifterClock shiftTimeClock) return null; + if (clock is not TimeShiftingClock shiftTimeClock) return null; shiftTimeClock.Shift = edit(shiftTimeClock.Shift); return shiftTimeClock.Shift.TotalSeconds; diff --git a/Lombiq.Tests.UI.Shortcuts/Startup.cs b/Lombiq.Tests.UI.Shortcuts/Startup.cs index c5fee468f..fbfe3cd81 100644 --- a/Lombiq.Tests.UI.Shortcuts/Startup.cs +++ b/Lombiq.Tests.UI.Shortcuts/Startup.cs @@ -44,6 +44,6 @@ public sealed class SetTimeStartup : StartupBase public override void ConfigureServices(IServiceCollection services) { services.RemoveImplementationsOf(); - services.AddSingleton(); + services.AddSingleton(); } } From 4b39266fd93bb55f6418baf66c798e6d74328bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Wed, 20 Nov 2024 22:10:58 +0100 Subject: [PATCH 7/8] Rename leftover local variable. --- Lombiq.Tests.UI.Shortcuts/Services/TimeShiftingClock.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lombiq.Tests.UI.Shortcuts/Services/TimeShiftingClock.cs b/Lombiq.Tests.UI.Shortcuts/Services/TimeShiftingClock.cs index 15fda1a41..3c9cd405d 100644 --- a/Lombiq.Tests.UI.Shortcuts/Services/TimeShiftingClock.cs +++ b/Lombiq.Tests.UI.Shortcuts/Services/TimeShiftingClock.cs @@ -43,9 +43,9 @@ public DateTimeOffset ConvertToTimeZone(DateTimeOffset dateTimeOffset, ITimeZone /// public static double? UpdateClock(IClock clock, Func edit) { - if (clock is not TimeShiftingClock shiftTimeClock) return null; + if (clock is not TimeShiftingClock timeShiftingClock) return null; - shiftTimeClock.Shift = edit(shiftTimeClock.Shift); - return shiftTimeClock.Shift.TotalSeconds; + timeShiftingClock.Shift = edit(timeShiftingClock.Shift); + return timeShiftingClock.Shift.TotalSeconds; } } From 90d2bc6a7cbce930a324d1658c07f3d8e29c316d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Thu, 21 Nov 2024 11:37:17 +0100 Subject: [PATCH 8/8] Rename SetShiftTimeAsync to SetTimeShiftAsync. --- Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs | 2 +- .../Extensions/ShortcutsUITestContextExtensions.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs b/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs index d73941f69..f96809215 100644 --- a/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs +++ b/Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs @@ -46,7 +46,7 @@ await context.FillInCodeMirrorEditorWithRetriesAsync( // This extension method navigates to the action which sets the time offset. You can set it in terms of // days or seconds. Both accept fractions and negative values. If both days and seconds are set, they // are added together. - await context.SetShiftTimeAsync(TimeSpan.FromDays(10)); + await context.SetTimeShiftAsync(TimeSpan.FromDays(10)); // Let's verify the date! var tenDaysFromNow = await GetNowAsync(context); diff --git a/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs b/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs index 53de816e7..78974168f 100644 --- a/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs +++ b/Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs @@ -746,7 +746,7 @@ public static Task ExecuteJsonRecipeSiteSettingAsync(this UITestContext conte /// /// Sets the time shift to a specific value. /// - public static Task SetShiftTimeAsync(this UITestContext context, TimeSpan time) + public static Task SetTimeShiftAsync(this UITestContext context, TimeSpan time) { context.EnsureValidOrchardCoreTenantScope(); return time.TotalDays >= 1.0 @@ -757,7 +757,7 @@ public static Task SetShiftTimeAsync(this UITestContext context, TimeSpan time) /// /// Adds the specified value to the time shift. /// - public static Task AddShiftTimeAsync(this UITestContext context, TimeSpan time) + public static Task AddTimeShiftAsync(this UITestContext context, TimeSpan time) { context.EnsureValidOrchardCoreTenantScope(); return time.TotalDays >= 1.0