We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See the old ones as a start:
using System.Collections.Generic; using EventSourcingTests.Aggregation; using JasperFx.Events; using JasperFx.Events.Projections; using Marten.Events; using Marten.Events.Daemon; using Marten.Events.Daemon.Internals; using Shouldly; using Xunit; namespace DaemonTests; public class EventRangeTests { [Fact] public void size_with_no_events() { var range = new EventRange(new ShardName("name"), 0, 100); range.Size.ShouldBe(100); } [Fact] public void size_with_events() { var range = new EventRange(new ShardName("name"), 0, 100) { Events = new List<IEvent> { new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), } }; range.Size.ShouldBe(5); } [Fact] public void skip_event_sequence() { var range = new EventRange(new ShardName("name"), 0, 100) { Events = new List<IEvent> { new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), } }; var sequence = 111; foreach (var @event in range.Events) { @event.Sequence = sequence++; } range.SkipEventSequence(114); range.Events.Count.ShouldBe(4); } [Fact] public void combine_shallow() { var range1 = new EventRange(new ShardName("name"), 0, 100) { Events = new List<IEvent> { new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), } }; var range2 = new EventRange(new ShardName("name"), 100, 200) { Events = new List<IEvent> { new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), } }; var range3 = new EventRange(new ShardName("name"), 200, 300) { Events = new List<IEvent> { new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), new Event<AEvent>(new AEvent()), } }; var combined = EventRange.CombineShallow(range1, range2, range3); combined.SequenceFloor.ShouldBe(0); combined.SequenceCeiling.ShouldBe(300); combined.ShardName.ShouldBe(range1.ShardName); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
See the old ones as a start:
The text was updated successfully, but these errors were encountered: