-
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.
fix: or-2515 return 200 when no changes on wijzig lidmaatschap
- Loading branch information
Showing
3 changed files
with
123 additions
and
1 deletion.
There are no files selected for viewing
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
113 changes: 113 additions & 0 deletions
113
test/AssociationRegistry.Test/LidmaatschappenTests/EqualsTest.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,113 @@ | ||
namespace AssociationRegistry.Test.LidmaatschappenTests; | ||
|
||
using Acties.VoegLidmaatschapToe; | ||
using AutoFixture; | ||
using Common.AutoFixture; | ||
using Vereniging; | ||
using Xunit; | ||
|
||
public class EqualsTest | ||
{ | ||
[Fact] | ||
public void With_The_Same_Values_Return_True() | ||
{ | ||
var fixture = new Fixture().CustomizeDomain(); | ||
var lidmaatschap1 = fixture.Create<Lidmaatschap>(); | ||
|
||
var lidmaatschap2 = Lidmaatschap.Create( | ||
lidmaatschap1.LidmaatschapId, | ||
new VoegLidmaatschapToeCommand.ToeTeVoegenLidmaatschap(lidmaatschap1.AndereVereniging, | ||
lidmaatschap1.AndereVerenigingNaam, | ||
new Geldigheidsperiode( | ||
new GeldigVan(lidmaatschap1.Geldigheidsperiode.Van), | ||
new GeldigTot(lidmaatschap1.Geldigheidsperiode.Tot)), | ||
lidmaatschap1.Identificatie, | ||
lidmaatschap1.Beschrijving)); | ||
|
||
Assert.True(lidmaatschap1.Equals(lidmaatschap2)); | ||
} | ||
|
||
[Fact] | ||
public void With_Other_Van_Value_Return_False() | ||
{ | ||
var fixture = new Fixture().CustomizeDomain(); | ||
var lidmaatschap1 = fixture.Create<Lidmaatschap>(); | ||
|
||
var lidmaatschap2 = lidmaatschap1 with | ||
{ | ||
Geldigheidsperiode = new Geldigheidsperiode(new GeldigVan(), new GeldigTot(lidmaatschap1.Geldigheidsperiode.Tot)), | ||
}; | ||
|
||
Assert.False(lidmaatschap1.Equals(lidmaatschap2)); | ||
} | ||
|
||
[Fact] | ||
public void With_Other_Tot_Value_Return_False() | ||
{ | ||
var fixture = new Fixture().CustomizeDomain(); | ||
var lidmaatschap1 = fixture.Create<Lidmaatschap>(); | ||
|
||
var lidmaatschap2 = lidmaatschap1 with | ||
{ | ||
Geldigheidsperiode = new Geldigheidsperiode(new GeldigVan(lidmaatschap1.Geldigheidsperiode.Van), new GeldigTot()) | ||
}; | ||
|
||
Assert.False(lidmaatschap1.Equals(lidmaatschap2)); | ||
} | ||
|
||
[Fact] | ||
public void With_Other_Beschrijving_Value_Return_False() | ||
{ | ||
var fixture = new Fixture().CustomizeDomain(); | ||
var lidmaatschap1 = fixture.Create<Lidmaatschap>(); | ||
|
||
var lidmaatschap2 = lidmaatschap1 with | ||
{ | ||
Beschrijving = fixture.Create<LidmaatschapBeschrijving>(), | ||
}; | ||
|
||
Assert.False(lidmaatschap1.Equals(lidmaatschap2)); | ||
} | ||
|
||
[Fact] | ||
public void With_Other_Identificatie_Value_Return_False() | ||
{ | ||
var fixture = new Fixture().CustomizeDomain(); | ||
var lidmaatschap1 = fixture.Create<Lidmaatschap>(); | ||
|
||
var lidmaatschap2 = lidmaatschap1 with | ||
{ | ||
Identificatie = fixture.Create<LidmaatschapIdentificatie>(), | ||
}; | ||
|
||
Assert.False(lidmaatschap1.Equals(lidmaatschap2)); | ||
} | ||
|
||
[Fact] | ||
public void With_Other_AndereVereniging_Value_Return_False() | ||
{ | ||
var fixture = new Fixture().CustomizeDomain(); | ||
var lidmaatschap1 = fixture.Create<Lidmaatschap>(); | ||
|
||
var lidmaatschap2 = lidmaatschap1 with | ||
{ | ||
AndereVereniging = fixture.Create<VCode>(), | ||
}; | ||
|
||
Assert.False(lidmaatschap1.Equals(lidmaatschap2)); | ||
} | ||
|
||
[Fact] | ||
public void With_Other_AndereVerenigingNaam_Value_Return_False() | ||
{ | ||
var fixture = new Fixture().CustomizeDomain(); | ||
var lidmaatschap1 = fixture.Create<Lidmaatschap>(); | ||
|
||
var lidmaatschap2 = lidmaatschap1 with | ||
{ | ||
AndereVerenigingNaam = fixture.Create<string>(), | ||
}; | ||
|
||
Assert.False(lidmaatschap1.Equals(lidmaatschap2)); | ||
} | ||
} |