-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EventBuffer.Version nad AggregateVersion as long (#39)
- Loading branch information
Showing
12 changed files
with
47 additions
and
51 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
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
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
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace Models.Events; | ||
|
||
public sealed record StoredEvent(object Id, int Version, object Payload); | ||
public sealed record StoredEvent(object Id, long Version, object Payload); |
4 changes: 1 addition & 3 deletions
4
test/Qowaiv.DomainModel.UnitTests/Models/SimpleEventSourcedAggregate.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
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
35 changes: 16 additions & 19 deletions
35
test/Qowaiv.DomainModel.UnitTests/TestTools/QowaivAssemblyAssertions.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 |
---|---|---|
@@ -1,30 +1,27 @@ | ||
using FluentAssertions.Execution; | ||
using FluentAssertions.Reflection; | ||
using Qowaiv; | ||
using System; | ||
using System.Reflection; | ||
|
||
namespace FluentAssertions | ||
namespace FluentAssertions; | ||
|
||
/// <summary>Extensions on <see cref="AssemblyAssertions"/>.</summary> | ||
internal static class QowaivAssemblyAssertions | ||
{ | ||
/// <summary>Extensions on <see cref="AssemblyAssertions"/>.</summary> | ||
public static class QowaivAssemblyAssertions | ||
/// <summary>Asserts the <see cref="Assembly"/> to have a specific public key.</summary> | ||
public static AndConstraint<AssemblyAssertions> HavePublicKey(this AssemblyAssertions assertions, string publicKey, string because = "", params object[] becauseArgs) | ||
{ | ||
/// <summary>Asserts the <see cref="Assembly"/> to have a specific public key.</summary> | ||
public static AndConstraint<AssemblyAssertions> HavePublicKey(this AssemblyAssertions assertions, string publicKey, string because = "", params object[] becauseArgs) | ||
{ | ||
Guard.NotNull(assertions, nameof(assertions)); | ||
Guard.NotNull(assertions, nameof(assertions)); | ||
|
||
var bytes = assertions.Subject.GetName().GetPublicKey() ?? Array.Empty<byte>(); | ||
var assemblyKey = BitConverter.ToString(bytes).Replace("-", ""); | ||
var bytes = assertions.Subject.GetName().GetPublicKey() ?? Array.Empty<byte>(); | ||
var assemblyKey = BitConverter.ToString(bytes).Replace("-", ""); | ||
|
||
Execute.Assertion | ||
.BecauseOf(because, becauseArgs) | ||
.ForCondition(assemblyKey == publicKey) | ||
.FailWith( | ||
$"Expected '{assertions.Subject}' to have public key: {publicKey},{Environment.NewLine}" + | ||
$"but got: {assemblyKey} instead."); | ||
Execute.Assertion | ||
.BecauseOf(because, becauseArgs) | ||
.ForCondition(assemblyKey == publicKey) | ||
.FailWith( | ||
$"Expected '{assertions.Subject}' to have public key: {publicKey},{Environment.NewLine}" + | ||
$"but got: {assemblyKey} instead."); | ||
|
||
return new AndConstraint<AssemblyAssertions>(assertions); | ||
} | ||
return new AndConstraint<AssemblyAssertions>(assertions); | ||
} | ||
} |