public void Should_write_many_events(int count, int threads) { var builders = TestHelpers.GenerateEventBuilders(count); using (Hercules.Management.CreateTemporaryStream(out var stream)) { builders.PushEvents(PushEvent.ToStream(stream), threads); var events = Hercules.Stream.ReadEvents(stream, count, count / 4); events.ShouldBeEqual(builders.ToEvents()); } }
public void Should_read_events_in_many_client_shards(int count) { var builders = TestHelpers.GenerateEventBuilders(count); using (Hercules.Management.CreateTemporaryStream(out var stream)) { builders.PushEvents(PushEvent.ToStream(stream)); var shards = Hercules.Stream.ReadEvents(stream, count, count / 4, 3); shards.SelectMany(x => x).ShouldBeEqual(builders.ToEvents()); foreach (var shard in shards) { shard.Should().NotBeEmpty(); } } }