Skip to content

Commit

Permalink
Adding another test case for a different coding path
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydmiller committed Jan 8, 2025
1 parent 27d78c7 commit d3267c8
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,33 @@ public async Task fetch_aggregate_that_is_completely_caught_up()
await theSession.SaveChangesAsync();
}

[Fact]
public async Task fetch_aggregate_that_is_completely_caught_up_with_no_version_supplied()
{
StoreOptions(opts =>
{
opts.Projections.Snapshot<SimpleAggregateAsString>(SnapshotLifecycle.Async);
opts.Events.StreamIdentity = StreamIdentity.AsString;
});

var streamId = Guid.NewGuid().ToString();

theSession.Events.StartStream<SimpleAggregateAsString>(streamId, new AEvent(), new BEvent(), new BEvent(), new BEvent(),
new CEvent(), new CEvent());
await theSession.SaveChangesAsync();

var daemon = await theStore.BuildProjectionDaemonAsync();
await daemon.RebuildProjectionAsync<SimpleAggregateAsString>(CancellationToken.None);

var stream = await theSession.Events.FetchForWriting<SimpleAggregateAsString>(streamId);
stream.Aggregate.ShouldNotBeNull();
stream.CurrentVersion.ShouldBe(6);

stream.AppendOne(new EEvent());
await theSession.SaveChangesAsync();
}



[Fact]
public async Task fetch_aggregate_that_is_completely_caught_up_use_exclusive_locks()
Expand Down

0 comments on commit d3267c8

Please sign in to comment.