Example #1
0
        public async Task FindAllByMerchantId_WhenMerchantHasntTransactions_ShouldReturnNull(
            Guid merchantId, List <Transaction> transactions, TransactionFinder sut)
        {
            transactions = new List <Transaction>();
            sut.TransactionRepository.FindAllByMerchantIdAsync(Arg.Is(merchantId)).Returns(transactions);

            var result = await sut.FindAllByMerchantIdAsync(merchantId);

            result.Should().BeNull();
        }
Example #2
0
        public async Task FindAllByMerchantId_WhenMerchantHasTransactions_ShouldReturnTransactionDtoList(
            Guid merchantId, List <Transaction> transactions, TransactionFinder sut)
        {
            sut.TransactionRepository.FindAllByMerchantIdAsync(
                Arg.Is(merchantId)).Returns(transactions);

            var result = await sut.FindAllByMerchantIdAsync(merchantId);

            result.Should().NotBeNullOrEmpty();
            result.Should().BeOfType(typeof(List <TransactionDto>));
        }