-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add tests + add idempotencykey
- Loading branch information
Showing
7 changed files
with
1,894 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
91 changes: 62 additions & 29 deletions
91
src/AddressRegistry.Projections.Integration/AddressLatestItemProjections.cs
Large diffs are not rendered by default.
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
22 changes: 22 additions & 0 deletions
22
test/AddressRegistry.Tests/AutoFixture/WithIntegerNisCode.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,22 @@ | ||
namespace AddressRegistry.Tests.AutoFixture | ||
{ | ||
using global::AutoFixture; | ||
using global::AutoFixture.Kernel; | ||
using StreetName; | ||
|
||
public class WithIntegerNisCode : ICustomization | ||
{ | ||
public void Customize(IFixture fixture) | ||
{ | ||
var nisCode = new NisCode(fixture.Create<int>().ToString()); | ||
fixture.Register(() => nisCode); | ||
|
||
fixture.Customizations.Add( | ||
new FilteringSpecimenBuilder( | ||
new FixedBuilder(nisCode.ToString()), | ||
new ParameterSpecification( | ||
typeof(string), | ||
"nisCode"))); | ||
} | ||
} | ||
} |
1,773 changes: 1,773 additions & 0 deletions
1,773
test/AddressRegistry.Tests/Integration/AddressLatestItemTest.cs
Large diffs are not rendered by default.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
test/AddressRegistry.Tests/Integration/IntegrationsTest.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,30 @@ | ||
namespace AddressRegistry.Tests.Integration | ||
{ | ||
using System; | ||
using Be.Vlaanderen.Basisregisters.ProjectionHandling.Connector; | ||
using Be.Vlaanderen.Basisregisters.ProjectionHandling.Testing; | ||
using Microsoft.EntityFrameworkCore; | ||
using Projections.Integration; | ||
|
||
public abstract class IntegrationProjectionTest<TProjection> | ||
where TProjection : ConnectedProjection<IntegrationContext> | ||
{ | ||
protected ConnectedProjectionTest<IntegrationContext, TProjection> Sut { get; } | ||
|
||
protected IntegrationProjectionTest() | ||
{ | ||
Sut = new ConnectedProjectionTest<IntegrationContext, TProjection>(CreateContext, CreateProjection); | ||
} | ||
|
||
protected virtual IntegrationContext CreateContext() | ||
{ | ||
var options = new DbContextOptionsBuilder<IntegrationContext>() | ||
.UseInMemoryDatabase(Guid.NewGuid().ToString()) | ||
.Options; | ||
|
||
return new IntegrationContext(options); | ||
} | ||
|
||
protected abstract TProjection CreateProjection(); | ||
} | ||
} |