public void TestInvalidateTwiceSuperfluous()
        {
            var changes = new MergedLogFileChanges(13);

            changes.InvalidateFrom(5);
            changes.InvalidateFrom(7);

            changes.Sections.Should().Equal(new object[]
            {
                LogFileSection.Invalidate(5, 8)
            });

            changes.TryGetFirstInvalidationIndex(out var index).Should().BeTrue();
            index.Should().Be(new LogLineIndex(5));
        }
        public void TestAppendInvalidate()
        {
            var changes = new MergedLogFileChanges(0);

            changes.Append(0, 42);
            changes.InvalidateFrom(20);

            changes.Sections.Should().Equal(new object[]
            {
                new LogFileSection(0, 20)
            });
        }
        public void TestInvalidateThenAppendWithGap()
        {
            var changes = new MergedLogFileChanges(10);

            changes.InvalidateFrom(5);
            changes.Append(7, 10);

            changes.Sections.Should().Equal(new object[]
            {
                LogFileSection.Invalidate(5, 5),
                new LogFileSection(5, 12)
            });
        }
        public void TestInvalidate()
        {
            var changes = new MergedLogFileChanges(42);

            changes.InvalidateFrom(10);

            changes.Sections.Should().Equal(new object[]
            {
                LogFileSection.Invalidate(10, 32)
            });

            changes.TryGetFirstInvalidationIndex(out var index).Should().BeTrue();
            index.Should().Be(new LogLineIndex(10));
        }
        public void TestInvalidateThenAppend()
        {
            var changes = new MergedLogFileChanges(10);

            changes.InvalidateFrom(5);
            changes.Append(5, 6);

            changes.Sections.Should().Equal(new object[]
            {
                LogFileSection.Invalidate(5, 5),
                new LogFileSection(5, 6)
            });

            changes.TryGetFirstInvalidationIndex(out var index).Should().BeTrue();
            index.Should().Be(new LogLineIndex(5));
        }