From 61fb9035185425eee904e415fe07d68cabf30250 Mon Sep 17 00:00:00 2001 From: Dhirender Singh Date: Wed, 3 Jul 2024 15:25:04 +0200 Subject: [PATCH] added test for blank comment --- .../RegistrationBusinessLogicTest.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/administration/Administration.Service.Tests/BusinessLogic/RegistrationBusinessLogicTest.cs b/tests/administration/Administration.Service.Tests/BusinessLogic/RegistrationBusinessLogicTest.cs index 4959f09092..9cd3381d83 100644 --- a/tests/administration/Administration.Service.Tests/BusinessLogic/RegistrationBusinessLogicTest.cs +++ b/tests/administration/Administration.Service.Tests/BusinessLogic/RegistrationBusinessLogicTest.cs @@ -529,6 +529,22 @@ public async Task DeclineRegistrationVerification_WithApplicationNotFound_Throws ex.ParamName.Should().Be("applicationId"); } + [Fact] + public async Task DeclineRegistrationVerification_WithNoComment_ThrowsConflictException() + { + // Arrange + var applicationId = Guid.NewGuid(); + A.CallTo(() => _applicationRepository.GetCompanyIdNameForSubmittedApplication(applicationId)) + .Returns<(Guid, string, Guid?, IEnumerable<(Guid, string, IdentityProviderTypeId, IEnumerable)>, IEnumerable)>(default); + Task Act() => _logic.DeclineRegistrationVerification(applicationId, "", CancellationToken.None); + + // Act + var ex = await Assert.ThrowsAsync(Act); + + // Assert + ex.Message.Should().Be("No comment set."); + } + [Fact] public async Task DeclineRegistrationVerification_WithMultipleIdps_CallsExpected() {