public async Task ForwardReadsNextAsync() { var firstPageCount = 10; var nextPageCount = 3; var logReader = new PageReaderData() { Id = Fixture.TestName, Count = firstPageCount }; long pageTop = PageReaderData.EOF; long pageBottom = (firstPageCount) * Fixture.TextLine(0).Length; Assert.True(Fixture.LineCount > firstPageCount + nextPageCount, "Not enough lines to perform test."); await PageReader.ReadFirstAsync(logReader); Assert.Equal(pageTop, logReader.PageTop); Assert.Equal(pageBottom, logReader.PageBottom); Assert.Equal(firstPageCount, logReader.Lines.Count()); pageTop = pageBottom; pageBottom = (firstPageCount + nextPageCount) * Fixture.TextLine(0).Length; logReader.Count = nextPageCount; await PageReader.ReadNextAsync(logReader); Assert.Equal(pageTop, logReader.PageTop); Assert.Equal(pageBottom, logReader.PageBottom); Assert.Equal(nextPageCount, logReader.Lines.Count()); for (var i = 0; i < nextPageCount; i++) { Assert.Equal(Fixture.Text(firstPageCount + i + 1), logReader.Lines.Skip(i).First()); } }
public async Task <ActionResult> Forward(string id) { return(List(await PageReader.ReadFirstAsync(new PageReaderData() { Id = id, Count = CountOptions[0] }))); }
public async Task <ActionResult> ForwardFirst(PageReaderData logReader) { return(List(await PageReader.ReadFirstAsync(logReader))); }