예제 #1
0
        public async Task GetPreviousShoutsPage_CallsAllExpectedServices()
        {
            // Arrange
            var shouts = new Shout[]
            {
                new Shout(),
                new Shout(),
                new Shout()
            };
            var shoutsResponse = new ShoutsResponse
            {
                ContinuationToken = new ContinuationToken(),
                Shouts            = shouts
            };

            _continuationTokenHelperMock
            .Setup(x => x.GetPreviousPageToken())
            .Returns(new ContinuationToken());

            _apiClientMock
            .Setup(x => x.GetShoutsResponse(It.IsAny <ContinuationToken>()))
            .ReturnsAsync(shoutsResponse);

            // Act
            var result = await _paginationService.GetPreviousShoutsPage();

            // Assert
            Assert.Equal(shouts, result);
            _continuationTokenHelperMock.Verify(x => x.AddToken(It.IsAny <ContinuationToken>()), Times.Never);
        }