public async Task ReturnPaymentDetails()
        {
            //Arrange
            var controller     = new PaymentDetailsController(_paymentService);
            var paymentId      = Guid.NewGuid();
            var bankResponseId = Guid.NewGuid();
            var paymentResult  = new PaymentDetails()
            {
                Id = paymentId, BankResponseId = bankResponseId, PaymentMethod = new PaymentMethod()
                {
                    CardExpiry = "12/22",
                    CardNumber = "1000200030004000",
                    Cvv        = "000"
                }
            };
            await _dbRepository.AddNewItem(paymentResult);

            //Act
            var response = await controller.Get(bankResponseId);

            var result          = response as OkObjectResult;
            var paymentResponse = (PaymentResponse)result.Value;

            //Assert
            result.Should().NotBeNull();
            paymentResponse.BankResponseId.Should().Be(bankResponseId);
        }
Beispiel #2
0
        public async Task ReturnNotFoundIfPaymentDoesNotExist()
        {
            //Arrange
            var bankResponseId = Guid.NewGuid();

            //Act
            var result = await _controller.Get(bankResponseId);

            var status = result as NotFoundResult;

            //Assert
            status.Should().NotBeNull();
        }