Beispiel #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);
        }
Beispiel #2
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);
        }
Beispiel #3
0
        public void TestGetOrderById()
        {
            OrderBusinessComponent service = new OrderBusinessComponent(this.context);
            Order order = new Order()
            {
                OrderId = 123
            };

            Expect.Once.On(context).Method("GetById").Will(Return.Value(order));
            Order resultOrder = service.GetOrderById(123);

            Assert.AreEqual <decimal>(order.OrderId, resultOrder.OrderId);
            mockBuilder.VerifyAllExpectationsHaveBeenMet();
        }