From 651af202e979d752d0738307f779be5e64757ba3 Mon Sep 17 00:00:00 2001 From: Ravi Bobbili Date: Thu, 2 Mar 2023 13:25:43 +0000 Subject: [PATCH 1/2] TLRC-9383 Freeze Service - Service Unavailable during Results calculation period --- .../Content/Help/ServiceUnavailable.Designer.cs | 2 +- .../Content/Help/ServiceUnavailable.resx | 2 +- .../Controllers/HelpController.cs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/Help/ServiceUnavailable.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/Help/ServiceUnavailable.Designer.cs index 58af19e92..14f7ede80 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Content/Help/ServiceUnavailable.Designer.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/Help/ServiceUnavailable.Designer.cs @@ -97,7 +97,7 @@ public static string Para_Unavailable_While_Results_Calculation { } /// - /// Looks up a localized string similar to You will be able to use the service from 12:00{0}.. + /// Looks up a localized string similar to You will be able to use the service from {0}.. /// public static string Para_Use_Service_From { get { diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/Help/ServiceUnavailable.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/Help/ServiceUnavailable.resx index a6692bb9b..fac348a13 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Content/Help/ServiceUnavailable.resx +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/Help/ServiceUnavailable.resx @@ -130,6 +130,6 @@ The Manage T Level results service is unavailable while we process and calculate overall T Level results. - You will be able to use the service from 12:00{0}. + You will be able to use the service from {0}. \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/HelpController.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/HelpController.cs index 8671ce6fa..e3dbdb1cb 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/HelpController.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/HelpController.cs @@ -64,10 +64,10 @@ public IActionResult UserGuide() [Route("service-unavailable", Name = RouteConstants.ServiceUnavailable)] public IActionResult ServiceUnavailable() { - var serviceAvailableFrom = _configuration.FreezePeriodEndDate.AddDays(1); + var serviceAvailableFrom = _configuration.FreezePeriodEndDate.AddSeconds(1); var viewModel = new ServiceUnavailableViewModel { - ServiceAvailableFrom = $"{serviceAvailableFrom.ToString("tt").ToLower()} on {serviceAvailableFrom.DayOfWeek} {serviceAvailableFrom:dd MMMM yyyy}" + ServiceAvailableFrom = $"{serviceAvailableFrom.ToString("hh:mmtt").ToLower()} on {serviceAvailableFrom.DayOfWeek} {serviceAvailableFrom:dd MMMM yyyy}" }; return View(viewModel); } From 301e3fec8c55ef7142526fd2fe5e93caff488745 Mon Sep 17 00:00:00 2001 From: Ravi Bobbili Date: Thu, 2 Mar 2023 14:57:03 +0000 Subject: [PATCH 2/2] TLRC-9383 Freeze Service - Service Unavailable during Results calculation period Unit tests are fixed --- .../HelpControllerTests/ServiceUnavailable/TestSetup.cs | 4 ++-- .../ServiceUnavailable/When_Action_IsCalled.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/HelpControllerTests/ServiceUnavailable/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/HelpControllerTests/ServiceUnavailable/TestSetup.cs index 084b27bb9..1259fc42c 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/HelpControllerTests/ServiceUnavailable/TestSetup.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/HelpControllerTests/ServiceUnavailable/TestSetup.cs @@ -1,8 +1,8 @@ using Microsoft.AspNetCore.Mvc; -using Sfa.Tl.ResultsAndCertification.Common.Extensions; using Sfa.Tl.ResultsAndCertification.Models.Configuration; using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; using Sfa.Tl.ResultsAndCertification.Web.Controllers; +using System; using System.Threading.Tasks; namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.HelpControllerTests.ServiceUnavailable @@ -17,7 +17,7 @@ public override void Setup() { Configuration = new ResultsAndCertificationConfiguration { - FreezePeriodEndDate = "31/07/2022".ParseStringToDateTimeWithFormat() + FreezePeriodEndDate = new DateTime(2022, 07, 31, 23, 59, 59, DateTimeKind.Utc) }; Controller = new HelpController(Configuration); diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/HelpControllerTests/ServiceUnavailable/When_Action_IsCalled.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/HelpControllerTests/ServiceUnavailable/When_Action_IsCalled.cs index 4aba74e13..517206d0d 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/HelpControllerTests/ServiceUnavailable/When_Action_IsCalled.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/HelpControllerTests/ServiceUnavailable/When_Action_IsCalled.cs @@ -11,7 +11,7 @@ public class When_Action_IsCalled : TestSetup public override void Given() { - _expectedValue = "am on Monday 01 August 2022"; + _expectedValue = "12:00am on Monday 01 August 2022"; } [Fact]