예제 #1
0
        public async Task GetPaymentByIdAsync_ValidRequest_ReturnPaymentResourceResponse()
        {
            SetValidUserInControllerContext();

            var paymentResource = new PaymentResource();

            _mapper
            .Setup(m => m.Map <Payment, PaymentResource>(It.IsAny <Payment>()))
            .Returns(paymentResource);

            var response = await _controller.GetPaymentByIdAsync(Guid.NewGuid());

            var result = response.Result as ObjectResult;

            Assert.Equal((int)HttpStatusCode.OK, result.StatusCode);
            Assert.IsType(typeof(PaymentResource), result.Value);
        }