Ejemplo n.º 1
0
        public void TestOrderAPI_ApproveOrder_ShouldReturnOrderStatusEqualToApprove()
        {
            Response = orderService.Approve(user, orderVMLight);
            OrderViewModelLight result = Response.Model as OrderViewModelLight;

            Assert.That(result.OrderStatusTypeId, Is.EqualTo(4));
        }
Ejemplo n.º 2
0
        public ServiceResponse ApproveOrder(OrderViewModelLight orderVMLight)
        {
            this.ServiceResponse = _orderServices.Approve(this.CurrentUser, orderVMLight);
            if (this.ServiceResponse.IsOK)
            {
                var OrderForEmail = this.ServiceResponse.Model as OrderViewModelLight;
            }

            return(this.ServiceResponse);
        }
Ejemplo n.º 3
0
        public void TestOrderService_Approve_ShouldChangeOrderStatusAsAccepted()
        {
            long _orderId             = this.db.Context.Orders.Where(o => o.OrderStatusTypeId != 4).OrderByDescending(o => o.OrderId).Select(o => o.OrderId).FirstOrDefault();
            OrderViewModelLight model = orderService.GetOrderModel(_orderId).Model as OrderViewModelLight;
            var result = orderService.Approve(user, model);

            Assert.That(result.IsOK, Is.EqualTo(true));
            Order order = this.db.Context.Orders.Where(o => o.OrderId == model.OrderId).FirstOrDefault();

            Assert.That(order.OrderStatusTypeId, Is.EqualTo(4));
        }