From a4fffacc0343c9ebb4960fbc4f91b8568b53aa7f Mon Sep 17 00:00:00 2001 From: Sherif Olaboye Date: Tue, 24 Dec 2024 10:16:30 +0000 Subject: [PATCH] TD-5168 Investigate the build failure for the dependabot Pull Request --- .../Controllers/Login/LoginControllerTests.cs | 6 +++--- .../Controllers/Register/ClaimAccountControllerTests.cs | 2 +- .../SupervisorController/SupervisorControllerTests.cs | 4 ++-- .../Configuration/CentreConfigurationControllerTests.cs | 2 +- .../Delegates/DeactivateDelegateControllerTests.cs | 2 +- .../TrackingSystem/Delegates/EnrolControllerTests.cs | 2 +- .../DigitalLearningSolutions.Web.Tests.csproj | 2 +- .../Services/CryptoServiceTests.cs | 4 ++-- .../Services/FreshdeskServiceTests.cs | 8 ++++---- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/DigitalLearningSolutions.Web.Tests/Controllers/Login/LoginControllerTests.cs b/DigitalLearningSolutions.Web.Tests/Controllers/Login/LoginControllerTests.cs index 2d1ac85d83..25588e4880 100644 --- a/DigitalLearningSolutions.Web.Tests/Controllers/Login/LoginControllerTests.cs +++ b/DigitalLearningSolutions.Web.Tests/Controllers/Login/LoginControllerTests.cs @@ -138,7 +138,7 @@ public async Task Invalid_model_should_render_basic_form_with_error() // Then result.Should().BeViewResult().WithViewName("Index").ModelAs(); - Assert.IsFalse(controller.ModelState.IsValid); + Assert.That(controller.ModelState.IsValid, Is.False); } [Test] @@ -263,7 +263,7 @@ public async Task Invalid_credentials_should_render_basic_form_with_error() // Then result.Should().BeViewResult().WithViewName("Index").ModelAs(); - Assert.IsFalse(controller.ModelState.IsValid); + Assert.That(controller.ModelState.IsValid, Is.False); } [Test] @@ -279,7 +279,7 @@ public async Task Login_to_unclaimed_delegate_account_should_render_basic_form_w // Then result.Should().BeViewResult().WithViewName("Index").ModelAs(); - Assert.IsFalse(controller.ModelState.IsValid); + Assert.That(controller.ModelState.IsValid, Is.False); } [Test] diff --git a/DigitalLearningSolutions.Web.Tests/Controllers/Register/ClaimAccountControllerTests.cs b/DigitalLearningSolutions.Web.Tests/Controllers/Register/ClaimAccountControllerTests.cs index 83bc88701e..411c76fbd0 100644 --- a/DigitalLearningSolutions.Web.Tests/Controllers/Register/ClaimAccountControllerTests.cs +++ b/DigitalLearningSolutions.Web.Tests/Controllers/Register/ClaimAccountControllerTests.cs @@ -515,7 +515,7 @@ public async Task CompleteRegistrationPost_with_invalid_model_display_with_valid .ModelAs().Should() .BeEquivalentTo(completeRegistrationViewModel); - Assert.IsFalse(controller.ModelState.IsValid); + Assert.That(controller.ModelState.IsValid, Is.False); } [Test] diff --git a/DigitalLearningSolutions.Web.Tests/Controllers/SupervisorController/SupervisorControllerTests.cs b/DigitalLearningSolutions.Web.Tests/Controllers/SupervisorController/SupervisorControllerTests.cs index 0581361535..1f8a52b92c 100644 --- a/DigitalLearningSolutions.Web.Tests/Controllers/SupervisorController/SupervisorControllerTests.cs +++ b/DigitalLearningSolutions.Web.Tests/Controllers/SupervisorController/SupervisorControllerTests.cs @@ -150,8 +150,8 @@ public void ExportCandidateAssessment_should_return_file_object_with_file_name_i // Assert Assert.Multiple(() => { - Assert.IsNotNull(result); - Assert.AreEqual(expectedFileName, result!.FileDownloadName); + Assert.That(result, Is.Not.Null); + Assert.That(result!.FileDownloadName, Is.EqualTo(expectedFileName)); }); } diff --git a/DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Centre/Configuration/CentreConfigurationControllerTests.cs b/DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Centre/Configuration/CentreConfigurationControllerTests.cs index 7ba01428a2..03e2a76f1e 100644 --- a/DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Centre/Configuration/CentreConfigurationControllerTests.cs +++ b/DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Centre/Configuration/CentreConfigurationControllerTests.cs @@ -87,7 +87,7 @@ public void EditCentreWebsiteDetails_should_show_validation_error_to_user_when_g // Then result.Should().BeViewResult().WithDefaultViewName() .ModelAs(); - Assert.IsFalse(controller.ModelState.IsValid); + Assert.That(controller.ModelState.IsValid, Is.False); } [TestCase("OVER_DAILY_LIMIT")] diff --git a/DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Delegates/DeactivateDelegateControllerTests.cs b/DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Delegates/DeactivateDelegateControllerTests.cs index 3cd25f78df..c4f97b6e5a 100644 --- a/DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Delegates/DeactivateDelegateControllerTests.cs +++ b/DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Delegates/DeactivateDelegateControllerTests.cs @@ -96,7 +96,7 @@ public void Index_post_returns_error_when_no_option_selected_to_deactivate() // Then result.Should().BeViewResult().ModelAs().DelegateId.Should().Be(DelegateId); - Assert.IsFalse(controller.ModelState.IsValid); + Assert.That(controller.ModelState.IsValid, Is.False); } diff --git a/DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Delegates/EnrolControllerTests.cs b/DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Delegates/EnrolControllerTests.cs index bf5ec33761..18317d4865 100644 --- a/DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Delegates/EnrolControllerTests.cs +++ b/DigitalLearningSolutions.Web.Tests/Controllers/TrackingSystem/Delegates/EnrolControllerTests.cs @@ -72,7 +72,7 @@ public void StartEnrolProcess_calls_expected_methods_and_returns_view() result.Should().BeRedirectToActionResult().WithActionName("Index"); - Assert.AreEqual(0, tempDataDictionary.Keys.Count); + Assert.That(tempDataDictionary.Keys.Count, Is.EqualTo(0)); } } } diff --git a/DigitalLearningSolutions.Web.Tests/DigitalLearningSolutions.Web.Tests.csproj b/DigitalLearningSolutions.Web.Tests/DigitalLearningSolutions.Web.Tests.csproj index ef4dd6e67f..9f1ed67f82 100644 --- a/DigitalLearningSolutions.Web.Tests/DigitalLearningSolutions.Web.Tests.csproj +++ b/DigitalLearningSolutions.Web.Tests/DigitalLearningSolutions.Web.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/DigitalLearningSolutions.Web.Tests/Services/CryptoServiceTests.cs b/DigitalLearningSolutions.Web.Tests/Services/CryptoServiceTests.cs index 404937f682..e294ce1fb1 100644 --- a/DigitalLearningSolutions.Web.Tests/Services/CryptoServiceTests.cs +++ b/DigitalLearningSolutions.Web.Tests/Services/CryptoServiceTests.cs @@ -20,7 +20,7 @@ public void VerifyHashedPassword_Returns_false_if_hashed_password_is_empty() var passwordIsCorrect = cryptoService.VerifyHashedPassword(null, "password"); // Then - Assert.IsFalse(passwordIsCorrect); + Assert.That(passwordIsCorrect, Is.False); } [Test] @@ -32,7 +32,7 @@ public void VerifyHashedPassword_Returns_true_for_hash_from_GetPasswordHash() var passwordIsCorrect = cryptoService.VerifyHashedPassword(passwordHash, password); // Then - Assert.IsTrue(passwordIsCorrect); + Assert.That(passwordIsCorrect, Is.True); } } } diff --git a/DigitalLearningSolutions.Web.Tests/Services/FreshdeskServiceTests.cs b/DigitalLearningSolutions.Web.Tests/Services/FreshdeskServiceTests.cs index b449824803..f502c49ff4 100644 --- a/DigitalLearningSolutions.Web.Tests/Services/FreshdeskServiceTests.cs +++ b/DigitalLearningSolutions.Web.Tests/Services/FreshdeskServiceTests.cs @@ -40,7 +40,7 @@ public void CreateNewTicket_returns_ticket_id_API_success() var apiResponse = freshdeskService.CreateNewTicket(ticketRequest); //Assert - Assert.AreEqual(expectedResponse, apiResponse); + Assert.That(apiResponse, Is.EqualTo(expectedResponse)); } [Test] public void CreateNewTicket_returns_API_Authentication_error() @@ -60,7 +60,7 @@ public void CreateNewTicket_returns_API_Authentication_error() var apiResponse = freshdeskService.CreateNewTicket(ticketRequest); //Assert - Assert.AreEqual(expectedResponse, apiResponse); + Assert.That(apiResponse, Is.EqualTo(expectedResponse)); } [Test] public void CreateNewTicket_returns_API_error() @@ -80,7 +80,7 @@ public void CreateNewTicket_returns_API_error() var apiResponse = freshdeskService.CreateNewTicket(ticketRequest); //Assert - Assert.AreEqual(expectedResponse, apiResponse); + Assert.That(apiResponse, Is.EqualTo(expectedResponse)); } [Test] public async Task CreateNewTicket_returns_API_data_if_retrieved() @@ -100,7 +100,7 @@ public async Task CreateNewTicket_returns_API_data_if_retrieved() var apiResponse = freshdeskService.CreateNewTicket(ticketRequest); //Assert - Assert.AreEqual(expectedResponse, apiResponse); + Assert.That(apiResponse, Is.EqualTo(expectedResponse)); } } }