private static MockPaymentMethodService SetupPaymentMethodService() { var service = new MockPaymentMethodService(); service.SaveEntity(new PaymentMethod() { Id = "1", CardholderName = "John Doe", CardNumber = "123512523123", CardVerificationCode = "123" }); return(service); }
public async Task GetAllPaymentMethodsAsync_ReturnsEmptyCollection_WhenServiceReturnsNull() { var paymentMethodService = new MockPaymentMethodService(); paymentMethodService.PaymentMethods = null; var target = new CheckoutDataRepository(null, paymentMethodService, null); var paymentMethods = await target.GetAllPaymentMethodsAsync(); Assert.IsNotNull(paymentMethods); Assert.AreEqual(0, paymentMethods.Count); }