Ejemplo n.º 1
0
        public IActionResult OrderDetails([FromQuery] GetOrderByIdRequestModel requestModel)
        {
            //var response = _getOrderByIdQueryHandler.GetOrderById(requestModel);
            var response = _mediator.Send(requestModel);

            return(Ok(response));
        }
 public GetOrderByIdResponseModel MakeOrder(GetOrderByIdRequestModel model)
 {
     //logic here
     return(new GetOrderByIdResponseModel
     {
         ProductName = "Ball",
         Quantity = 1,
         UserName = "******"
     });
 }
Ejemplo n.º 3
0
        public void GetOrderById_Success_Result()
        {
            var getOrderByIdRequestModel = new GetOrderByIdRequestModel();

            Mediator.Setup(x => x.Send(It.IsAny <GetOrderByIdRequestModel>(), new CancellationToken())).
            ReturnsAsync(new GetOrderByIdResponseModel());
            var orderController = new OrderController(Mediator.Object);

            //Action
            var result = orderController.OrderDetails(getOrderByIdRequestModel);

            //Assert
            Assert.IsType <OkObjectResult>(result);
        }
Ejemplo n.º 4
0
        public async Task <IActionResult> Get([FromQuery] GetOrderByIdRequestModel requestModel)
        {
            var response = await _mediator.Send(requestModel);

            return(Ok(response));
        }
        public IActionResult OrderDetails([FromBody] GetOrderByIdRequestModel orderByIdRequestModel)
        {
            var response = _mediator.Send(orderByIdRequestModel);

            return(Ok(response));
        }
Ejemplo n.º 6
0
        public IActionResult OrderDetails([FromQuery] GetOrderByIdRequestModel requestModel)
        {
            var response = getOrderByIdQueryHandler.MakeOrder(requestModel);

            return(Ok(response));
        }