Skip to content

Commit

Permalink
Update ScheduleActorConsolidationsHandlerTests.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
FirestarJes committed Dec 27, 2024
1 parent 62b59e3 commit 550aedd
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}
}

0 comments on commit 550aedd

Please sign in to comment.