From 550aeddeb0c4bf50995a862e6c179a82ec1fe922 Mon Sep 17 00:00:00 2001 From: Jesper Justesen <1972142+FirestarJes@users.noreply.github.com> Date: Fri, 27 Dec 2024 13:26:10 +0100 Subject: [PATCH] Update ScheduleActorConsolidationsHandlerTests.cs --- .../Handlers/ScheduleActorConsolidationsHandlerTests.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/marketparticipant/Energinet.DataHub.MarketParticipant.Tests/Handlers/ScheduleActorConsolidationsHandlerTests.cs b/source/marketparticipant/Energinet.DataHub.MarketParticipant.Tests/Handlers/ScheduleActorConsolidationsHandlerTests.cs index cac5fdfbc..c1eb6da85 100644 --- a/source/marketparticipant/Energinet.DataHub.MarketParticipant.Tests/Handlers/ScheduleActorConsolidationsHandlerTests.cs +++ b/source/marketparticipant/Energinet.DataHub.MarketParticipant.Tests/Handlers/ScheduleActorConsolidationsHandlerTests.cs @@ -13,14 +13,13 @@ // limitations under the License. using System; -using System.ComponentModel.DataAnnotations; -using System.Linq; using System.Threading; using System.Threading.Tasks; using Energinet.DataHub.MarketParticipant.Application.Commands.Actors; using Energinet.DataHub.MarketParticipant.Application.Handlers.Actors; using Energinet.DataHub.MarketParticipant.Application.Services; using Energinet.DataHub.MarketParticipant.Domain; +using Energinet.DataHub.MarketParticipant.Domain.Exception; using Energinet.DataHub.MarketParticipant.Domain.Repositories; using Energinet.DataHub.MarketParticipant.Domain.Services.Rules; using Energinet.DataHub.MarketParticipant.Tests.Common; @@ -52,7 +51,7 @@ public async Task Handle_InvalidFromActorId_ThrowsException() // Act + Assert var exception = await Record.ExceptionAsync(() => target.Handle(command, CancellationToken.None)); Assert.NotNull(exception); - Assert.Equal(typeof(ValidationException), exception.GetType()); + Assert.Equal(typeof(NotFoundValidationException), exception.GetType()); Assert.Contains(exception.Message, $"Entity '{fromActorId}' does not exist.", StringComparison.OrdinalIgnoreCase); } @@ -80,7 +79,7 @@ public async Task Handle_InvalidToActorId_ThrowsException() // Act + Assert var exception = await Record.ExceptionAsync(() => target.Handle(command, CancellationToken.None)); Assert.NotNull(exception); - Assert.Equal(typeof(ValidationException), exception.GetType()); + Assert.Equal(typeof(NotFoundValidationException), exception.GetType()); Assert.Contains(exception.Message, $"Entity '{toActorId}' does not exist.", StringComparison.OrdinalIgnoreCase); } }