コード例 #1
0
        public async Task GetCounters_ReturnsCountersSetDto()
        {
            _userResolverServiceMock.Setup(m => m.GetUserId())
            .Returns(It.IsAny <int>());
            _bookServiceMock.Setup(m => m.GetNumberOfBooksInReadStatusAsync(It.IsAny <int>()))
            .ReturnsAsync(_countersSetDto.ReadBooksCount);
            _requestServiceMock.Setup(m => m.GetNumberOfRequestedBooksAsync(It.IsAny <int>()))
            .ReturnsAsync(_countersSetDto.RequestedBooksCount);
            _bookServiceMock.Setup(m => m.GetNumberOfTimesRegisteredBooksWereReadAsync(It.IsAny <int>()))
            .ReturnsAsync(_countersSetDto.RegisteredBooksWereReadCount);
            _wishListServiceMock.Setup(m => m.GetNumberOfWishedBooksAsync(It.IsAny <int>()))
            .ReturnsAsync(_countersSetDto.WishedBooksCount);

            var result = await _controller.GetCounters();

            result.Value.Should().BeEquivalentTo(_countersSetDto);
        }