Exemplo n.º 1
0
        public async Task GetAcquirerByTransaction_WhenMerchantNotFound_ShouldReturnUndefined(
            TransactionDto transactionDto, Merchant merchant, MerchantConfigurationAcquirerFinder sut)
        {
            merchant = null;
            sut.MerchantFinder.FindByIdAsync(Arg.Is(transactionDto.MerchantId.Value)).Returns(merchant);

            var result = await sut.GetAcquirerByTransaction(transactionDto);

            result.Should().BeEquivalentTo(CardBrand.Undefined);
        }
Exemplo n.º 2
0
        public async Task GetAcquirerByTransaction_WhenMerchantHasntConfigurationForSelectedCardBrand_ShouldReturnUndefined(
            TransactionDto transactionDto, Merchant merchant, MerchantConfigurationAcquirerFinder sut)
        {
            transactionDto.Payment.CreditCard.Brand = CardBrand.Master;
            merchant.PaymentConfigurations          = new List <MerchantPaymentConfiguration>
            {
                new MerchantPaymentConfiguration {
                    Acquirer = Acquirer.Cielo, Brand = CardBrand.Visa
                }
            };

            sut.MerchantFinder.FindByIdAsync(Arg.Is(transactionDto.MerchantId.Value)).Returns(merchant);

            var result = await sut.GetAcquirerByTransaction(transactionDto);

            result.Should().BeEquivalentTo(CardBrand.Undefined);
        }