-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: or-1716 add test for VerenigingMoetGemarkeerdZijnAlsDubbelOmGec…
…orrigeerdTeKunnenWorden
- Loading branch information
Showing
5 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
src/AssociationRegistry/Resources/ExceptionMessages.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...istry.Test/Dubbels/When_Corrigeer_Markering_Als_Dubbel_Van/Given_GeenDubbeleVereniging.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace AssociationRegistry.Test.Dubbels.When_Corrigeer_Markering_Als_Dubbel_Van; | ||
|
||
using Acties.CorrigeerMarkeringAlsDubbelVan; | ||
using AssociationRegistry.Framework; | ||
using Resources; | ||
using AssociationRegistry.Test.Common.AutoFixture; | ||
using AssociationRegistry.Test.Common.Framework; | ||
using Common.Scenarios.CommandHandling; | ||
using Vereniging; | ||
using Vereniging.Exceptions; | ||
using AutoFixture; | ||
using FluentAssertions; | ||
using Marten; | ||
using Moq; | ||
using Wolverine.Marten; | ||
using Xunit; | ||
|
||
public class Given_GeenDubbeleVereniging | ||
{ | ||
[Fact] | ||
public async Task Then_Throws_VerenigingKanGeenDubbelWordenVanVerwijderdeVereniging() | ||
{ | ||
var fixture = new Fixture().CustomizeDomain(); | ||
var scenario = new FeitelijkeVerenigingWerdGeregistreerdScenario(); | ||
var verenigingsRepositoryMock = new VerenigingRepositoryMock(scenario.GetVerenigingState()); | ||
var command = fixture.Create<CorrigeerMarkeringAlsDubbelVanCommand>() with | ||
{ | ||
VCode = VCode.Create(scenario.VCode), | ||
}; | ||
var commandEnvelope = new CommandEnvelope<CorrigeerMarkeringAlsDubbelVanCommand>(command, fixture.Create<CommandMetadata>()); | ||
|
||
var sut = new CorrigeerMarkeringAlsDubbelVanCommandHandler(verenigingsRepositoryMock, | ||
Mock.Of<IMartenOutbox>(), | ||
Mock.Of<IDocumentSession>() | ||
); | ||
|
||
var exception = await Assert.ThrowsAsync<VerenigingMoetGemarkeerdZijnAlsDubbelOmGecorrigeerdTeKunnenWorden> | ||
(async () => await sut.Handle(commandEnvelope, CancellationToken.None)); | ||
|
||
exception.Message.Should().Be(ExceptionMessages.VerenigingMoetGemarkeerdZijnAlsDubbelOmGecorrigeerdTeKunnenWorden); | ||
} | ||
} |
9 changes: 4 additions & 5 deletions
9
...bbels/When_Corrigeer_Markering_Als_Dubbel_Van/Given_VerenigingMetRechtspersoonlijkheid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters