public async Task CreatePaymentRequestShouldReturn201Response() { MockPaymentsRepository.Setup(x => x.ProcessPayment(It.IsAny <PaymentEntry>())).ReturnsAsync(new BaseResult() { Success = true, Message = "example message" }); var response = await this.Controller.CreatePayment(FakeCreatePaymentData.FakeCreatePaymentRequest()) as CreatedAtActionResult; Assert.IsNotNull(response); Assert.IsNotNull(response.Value); Assert.AreEqual(201, response.StatusCode); }
public async Task CreatePaymentRequestShouldReturn201Response() { MockPaymentsRepository.Setup(x => x.AddPayment(It.IsAny <PaymentEntry>())).ReturnsAsync(new BaseResult() { Success = true, Message = "example message" }); MockBankRepository.Setup(x => x.RequestPayment(It.IsAny <MockBankPaymentRequest>())).Returns(new MockBankResponse() { Identifier = Guid.NewGuid().ToString(), Status = CheckOut.PaymentGateway.Core.Enum.PaymentStatus.Authorized }); var response = await this.Controller.CreatePayment(FakeCreatePaymentData.FakeCreatePaymentRequest()) as CreatedAtActionResult; Assert.IsNotNull(response); Assert.IsNotNull(response.Value); Assert.AreEqual(201, response.StatusCode); }