public async Task GetAllAchievementsAsync(PagingInfo pagingInfo) { //Arrange var achievements = AchievementDumbData.GetRandomEntities(5); var paging = ReturnPagingInfoDumbData.GetForModel(pagingInfo, achievements); var expectedValue = ReturnPagingInfoDumbData.GetWithModels <ReadAchievementModel, Achievement>(paging, _mapper); var cancellationToken = new CancellationToken(); _achievementRepository.Setup(x => x.GetAllDataAsync(It.IsAny <PagingInfo>(), cancellationToken)).Returns(Task.FromResult(paging)); // Act var response = await _achievementService.GetAllAchievementsAsync(pagingInfo, cancellationToken); // Assert _achievementRepository.Verify(x => x.GetAllDataAsync(It.IsAny <PagingInfo>(), cancellationToken), Times.Once); response.Should().BeEquivalentTo(expectedValue); }