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); }
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); }