public void ShouldThrowOnInvalidSliceArguments(int start, int length) { // Arrange var array = new[] { new TestEvent(), new TestEvent(), new TestEvent() }; var batch = new EventBatch <TestEvent>(array, 0, 3); // Act/Assert Assert.Throws <ArgumentOutOfRangeException>(() => batch.Slice(start, length)); }
public void ShouldGetSlice(int start, int length) { // Arrange var array = new[] { new TestEvent(), new TestEvent(), new TestEvent() }; var batch = new EventBatch <TestEvent>(array, 0, 3); // Act var slice = batch.Slice(start, length); // Assert Assert.AreEqual(batch.AsSpan().Slice(start, length).ToArray(), slice.ToArray()); }