Skip to content

Commit

Permalink
chore: pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
mvarendorff2 committed Mar 15, 2024
1 parent ccf7d7c commit 6a61399
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Fluss.Testing/AggregateTestBed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public AggregateTestBed()
{
var validator = new Mock<IRootValidator>();
validator.Setup(v => v.ValidateEvent(It.IsAny<EventEnvelope>(), It.IsAny<IReadOnlyList<EventEnvelope>?>()))
.Returns<EventEnvelope>(_ => Task.CompletedTask);
.Returns<EventEnvelope, IReadOnlyList<EventEnvelope>?>((_, _) => Task.CompletedTask);

Check warning on line 21 in src/Fluss.Testing/AggregateTestBed.cs

View check run for this annotation

Codecov / codecov/patch

src/Fluss.Testing/AggregateTestBed.cs#L21

Added line #L21 was not covered by tests
validator.Setup(v => v.ValidateAggregate(It.IsAny<AggregateRoot>(), It.IsAny<UnitOfWork.UnitOfWork>()))
.Returns<AggregateRoot, UnitOfWork.UnitOfWork>((_, _) => Task.CompletedTask);

Expand Down
2 changes: 1 addition & 1 deletion src/Fluss.UnitTest/Core/UnitOfWork/UnitOfWorkTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public UnitOfWorkTest()

_validator = new Mock<IRootValidator>(MockBehavior.Strict);
_validator.Setup(v => v.ValidateEvent(It.IsAny<EventEnvelope>(), It.IsAny<IReadOnlyList<EventEnvelope>?>()))
.Returns<EventEnvelope>(_ => Task.CompletedTask);
.Returns<EventEnvelope, IReadOnlyList<EventEnvelope>?>((_, _) => Task.CompletedTask);
_validator.Setup(v => v.ValidateAggregate(It.IsAny<AggregateRoot>(), It.IsAny<Fluss.UnitOfWork.UnitOfWork>()))
.Returns<AggregateRoot, Fluss.UnitOfWork.UnitOfWork>((_, _) => Task.CompletedTask);

Expand Down
3 changes: 2 additions & 1 deletion src/Fluss/UnitOfWork/UnitOfWork.Aggregates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ internal async ValueTask CommitInternal()
using var activity = FlussActivitySource.Source.StartActivity();

var validatedEnvelopes = new List<EventEnvelope>();
foreach (var envelope in PublishedEventEnvelopes) {
foreach (var envelope in PublishedEventEnvelopes)
{
await _validator.ValidateEvent(envelope, validatedEnvelopes);
validatedEnvelopes.Add(envelope);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Fluss/Validation/RootValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public async Task ValidateEvent(EventEnvelope envelope, IReadOnlyList<EventEnvel
var willBePublishedEnvelopes = previousEnvelopes ?? new List<EventEnvelope>();

var versionedUnitOfWork = unitOfWork.WithPrefilledVersion(envelope.Version - willBePublishedEnvelopes.Count - 1);

Check warning on line 63 in src/Fluss/Validation/RootValidator.cs

View check run for this annotation

Codecov / codecov/patch

src/Fluss/Validation/RootValidator.cs#L63

Added line #L63 was not covered by tests
foreach (var willBePublishedEnvelope in willBePublishedEnvelopes) {
foreach (var willBePublishedEnvelope in willBePublishedEnvelopes)
{
versionedUnitOfWork.PublishedEventEnvelopes.Enqueue(willBePublishedEnvelope);
}

Check warning on line 67 in src/Fluss/Validation/RootValidator.cs

View check run for this annotation

Codecov / codecov/patch

src/Fluss/Validation/RootValidator.cs#L65-L67

Added lines #L65 - L67 were not covered by tests

Expand Down

0 comments on commit 6a61399

Please sign in to comment.