public void TestDoQueryMax() { var executor = new MockArchiveExecutor(); var man = new ArchiveManager <PropertyHelperTestCompany>(executor, new Mock <IDateTimeConverter>().Object, new ArchiveExecutionContextProvider()); var result = man.DoQuery(new LinqRestrictionBuilder <PropertyHelperTestCompany>(), noItems: 15); Assert.Equal(0, executor.Page); Assert.Equal(15, executor.MaxItems); Assert.Equal(ArchiveQueryParameters.DEFAULT_PAGE_SIZE, executor.Parameters.PageSize); }
public void TestDoQueryTakeMax() { var executor = new MockArchiveExecutor(); var man = new ArchiveManager <PropertyHelperTestCompany>(executor, new ArchiveExecutionContextProvider(), new Mock <IResultParser>().Object); var result = man.DoQuery(new LinqRestrictionBuilder <PropertyHelperTestCompany>(), noItems: 15, skip: 30); Assert.Equal(3, executor.Page); Assert.Equal(15, executor.MaxItems); Assert.Equal(10, executor.Parameters.PageSize); }
public void TestDoQuerySkip() { var executor = new MockArchiveExecutor(); var dateTimeConverter = new Mock <IDateTimeConverter>(); var man = new ArchiveManager <PropertyHelperTestCompany>(executor, dateTimeConverter.Object, new ArchiveExecutionContextProvider()); var result = man.DoQuery(new LinqRestrictionBuilder <PropertyHelperTestCompany>(), noItems: 0, skip: 13); Assert.Equal(1, executor.Page); Assert.Equal(0, executor.MaxItems); Assert.Equal(13, executor.Parameters.PageSize); }