-
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-2513 test format and null checks for VerrijkteGemeentenaam
- Loading branch information
Showing
5 changed files
with
79 additions
and
29 deletions.
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
28 changes: 28 additions & 0 deletions
28
test/AssociationRegistry.Test/When_Creating_A_VerrijkteGemeentenaam/WithPostnaam.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,28 @@ | ||
namespace AssociationRegistry.Test.When_Formatting_A_VerrijkteGemeentenaam; | ||
|
||
using Events; | ||
using FluentAssertions; | ||
using Grar.Models.PostalInfo; | ||
using Xunit; | ||
|
||
public class WithEmptyOrNull | ||
{ | ||
[Theory] | ||
[InlineData("", "")] | ||
[InlineData(null, "")] | ||
[InlineData("", null)] | ||
[InlineData(null, "Affligem")] | ||
[InlineData("Affligem", null)] | ||
public void WithPostNaam_Then_An_Exception_Is_Thrown(string postnaam, string gemeentenaam) | ||
{ | ||
Assert.Throws<ArgumentException>(() => VerrijkteGemeentenaam.MetPostnaam(Postnaam.FromValue(postnaam), gemeentenaam)); | ||
} | ||
|
||
[Theory] | ||
[InlineData("")] | ||
[InlineData(null)] | ||
public void WithoutPostNaam_Then_An_Exception_Is_Thrown(string gemeentenaam) | ||
{ | ||
Assert.Throws<ArgumentException>(() => VerrijkteGemeentenaam.ZonderPostnaam(gemeentenaam)); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
test/AssociationRegistry.Test/When_Formatting_A_VerrijkteGemeentenaam/WithPostnaam.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,17 @@ | ||
namespace AssociationRegistry.Test.When_Formatting_A_VerrijkteGemeentenaam; | ||
|
||
using Events; | ||
using FluentAssertions; | ||
using Grar.Models.PostalInfo; | ||
using Xunit; | ||
|
||
public class WithPostnaam | ||
{ | ||
[Fact] | ||
public void Then_It_FormatsCorrectly() | ||
{ | ||
var sut = VerrijkteGemeentenaam.MetPostnaam(Postnaam.FromValue("Hekelgem"), "Affligem"); | ||
|
||
sut.Format().Should().BeEquivalentTo("Hekelgem (Affligem)"); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
test/AssociationRegistry.Test/When_Formatting_A_VerrijkteGemeentenaam/WithoutPostnaam.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,17 @@ | ||
namespace AssociationRegistry.Test.When_Formatting_A_VerrijkteGemeentenaam; | ||
|
||
using Events; | ||
using FluentAssertions; | ||
using Grar.Models.PostalInfo; | ||
using Xunit; | ||
|
||
public class WithoutPostnaam | ||
{ | ||
[Fact] | ||
public void Then_It_FormatsCorrectly() | ||
{ | ||
var sut = VerrijkteGemeentenaam.ZonderPostnaam("Affligem"); | ||
|
||
sut.Format().Should().BeEquivalentTo("Affligem"); | ||
} | ||
} |