示例#1
0
        public async Task get_deposits_should_return_paged_results_of_deposits()
        {
            var query = new GetDeposits();

            _consumerService.GetDepositsAsync(query)
            .Returns(PagedResult <DepositDetails> .Create(new[] { GetDepositDetails() }, 1, 1, 1, 1));
            var result = await _rpc.ndm_getDeposits(query);

            await _consumerService.Received().GetDepositsAsync(query);

            result.Data.Items.Should().ContainSingle();
            result.Data.Page.Should().Be(1);
            result.Data.Results.Should().Be(1);
            result.Data.TotalPages.Should().Be(1);
            result.Data.TotalResults.Should().Be(1);
            result.Data.IsEmpty.Should().BeFalse();
            VerifyDepositDetails(result.Data.Items.Single());
        }