public async Task EstimateTotal_ShouldReturnOne_IfNoLeaseDocumentsCreated() { IReadOnlyList <ILease> leases = new List <ILease>(0); var sut = new RemainingWorkEstimator( Mock.Of <ILeaseContainer>(m => m.GetAllLeasesAsync() == Task.FromResult(leases)), Mock.Of <IChangeFeedDocumentClient>(), collectionSelfLink, 1); long pendingWork = await sut.GetEstimatedRemainingWork(); Assert.Equal(1, pendingWork); }
public async Task EstimateTotal_ShouldReturnPendingWork_IfOnePartition() { IReadOnlyList <ILease> leases = new List <ILease> { Mock.Of <ILease>(l => l.PartitionId == "1" && l.ContinuationToken == "100") }; var sut = new RemainingWorkEstimator( Mock.Of <ILeaseContainer>(m => m.GetAllLeasesAsync() == Task.FromResult(leases)), Mock.Of <IChangeFeedDocumentClient>() .SetupQueryResponse("1", "100", "101", "1:106"), collectionSelfLink, 1); long pendingWork = await sut.GetEstimatedRemainingWork(); Assert.Equal(6, pendingWork); }
public async Task Estimate_ShouldReturnPendingWork() { long pendingWork = await remainingWorkEstimator.GetEstimatedRemainingWork(); Assert.Equal(6, pendingWork); }