public void Enumerable_Returns_All_Items_In_Multiple_Pages() { var expectedVersions = new System.Collections.Generic.List <S3ObjectVersion> { new S3ObjectVersion { }, new S3ObjectVersion { } }; var s3client = A.Fake <IAmazonS3>(); A.CallTo(() => s3client.ListVersionsAsync(default(ListVersionsRequest), default(CancellationToken))) .WithAnyArguments() .ReturnsNextFromSequence( new ListVersionsResponse { NextKeyMarker = "nextKeyMarker", Versions = expectedVersions }, new ListVersionsResponse { Versions = expectedVersions }); var enumerable = new S3ObjectVersionsEnumerable(s3client, A.Fake <ListVersionsRequest>()); Assert.True(enumerable.Count() == expectedVersions.Count * 2); }
public void Enumerable_Returns_No_Items_When_Empty() { var enumerable = new S3ObjectVersionsEnumerable(A.Fake <IAmazonS3>(), A.Fake <ListVersionsRequest>()); Assert.True(enumerable.Count() == 0); }