public void TestAppendGap() { var changes = new MergedLogFileChanges(0); changes.Append(0, 2); changes.Append(1, 2); changes.Sections.Should().Equal(new object[] { new LogFileSection(0, 3) }); }
public void TestAppendTwice() { var changes = new MergedLogFileChanges(101); changes.Append(101, 6); changes.Append(107, 10); changes.Sections.Should().Equal(new object[] { new LogFileSection(101, 16) }); }
public void TestAppendInvalidateAppend() { var changes = new MergedLogFileChanges(0); changes.Append(0, 2); changes.InvalidateFrom(1); changes.Append(1, 1); changes.Sections.Should().Equal(new object[] { new LogFileSection(0, 2) }); }
public void TestAppend() { var changes = new MergedLogFileChanges(101); changes.Append(101, 5); changes.Sections.Should().Equal(new object[] { new LogFileSection(101, 5) }); changes.TryGetFirstInvalidationIndex(out var index).Should().BeFalse(); index.Should().Be(LogLineIndex.Invalid); }
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 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)); }