public async Task GivenAPaymentId_WhenPaymentIsFound_ThenReturnPaymentStatus() { var payment = TestPayment.ValidPayment(_paymentId); SetupPaymentStoreResponse(_paymentId, payment); var response = await GetAsync(_paymentId); var paymentResponse = await ReadAsAsync <PaymentResponse>(response); paymentResponse.Status.Should().Be(payment.Status); }
public async Task GivenAPaymentId_WhenPaymentIsFound_ThenReturnMaskedPayment() { var payment = TestPayment.ValidPayment(_paymentId); SetupPaymentStoreResponse(_paymentId, payment); var response = await GetAsync(_paymentId); var paymentResponse = await ReadAsAsync <PaymentResponse>(response); paymentResponse.CardNumber.Should().NotBe(payment.CardNumber); paymentResponse.CardNumber.Should().Be(payment.MaskedCardNumber); }
public async Task GivenAPaymentId_WhenPaymentIsFound_ThenReturnPayment() { var payment = TestPayment.ValidPayment(_paymentId); SetupPaymentStoreResponse(_paymentId, payment); var response = await GetAsync(_paymentId); var paymentResponse = await ReadAsAsync <PaymentResponse>(response); paymentResponse.Id.Should().Be(_paymentId); paymentResponse.ExpiryMonth.Should().Be(payment.ExpiryMonth); paymentResponse.ExpiryYear.Should().Be(paymentResponse.ExpiryYear); paymentResponse.Currency.Should().Be(paymentResponse.Currency); paymentResponse.Amount.Should().Be(paymentResponse.Amount); }
private void SetupPaymentStoreResponse(Guid paymentId, Payment payment = null) { _paymentStore .Setup(o => o.Get($"{MerchantId}{paymentId}")) .Returns(payment ?? TestPayment.ValidPayment(paymentId)); }