예제 #1
0
        public GetOrderResponse GetOrderById(GetOrderRequest request)
        {
            GetOrderResponse response = new GetOrderResponse();
            OrderBusinessComponent bc = DependencyInjectionHelper.GetOrderBusinessComponent();

            response.Order = OrderAdapter.OrderToDto(bc.GetOrderById(request.Id));

            return response;
        }
        public void TestGetOrder()
        {
            int orderId = 1;
            GetOrderResponse response = new GetOrderResponse();
            response.Order = new OrderDTO() {Id = orderId};

            Expect.Once.On(service).Method("GetOrderById").Will(Return.Value(response));
            OrderDTO order = serviceFacade.GetOrderById(orderId);
            Assert.AreEqual(order.Id, orderId);
        }
예제 #3
0
        public GetOrderResponse GetOrderById(GetOrderRequest request)
        {   
            if (!HttpContext.Current.User.Identity.IsAuthenticated)
                throw new FaultException<NotAuthenticatedFault>(new NotAuthenticatedFault());
            GetOrderResponse response = new GetOrderResponse();
            OrderBusinessComponent bc = DependencyInjectionHelper.GetOrderBusinessComponent();

            response.Order = OrderAdapter.OrderToDto(bc.GetOrderById(request.Id));
           
            return response;
        }