public void Ensure_order_can_only_be_voided_when_orderStatus_is_not_cancelled_and_paymentstatus_is_authorized_and_paymentModule_supports_void()
        {
            _paymentService.Expect(ps => ps.SupportVoid("paymentMethodSystemName_that_supports_void")).Return(true);
            _paymentService.Expect(ps => ps.SupportVoid("paymentMethodSystemName_that_don't_support_void")).Return(false);
            var order = new Order();

            order.OrderTotal = 1;
            order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_void";

            foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus)))
            {
                foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus)))
                {
                    foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus)))
                    {
                        order.OrderStatus    = os;
                        order.PaymentStatus  = ps;
                        order.ShippingStatus = ss;

                        if ((os != OrderStatus.Cancelled) &&
                            (ps == PaymentStatus.Authorized))
                        {
                            _orderProcessingService.CanVoid(order).ShouldBeTrue();
                        }
                        else
                        {
                            _orderProcessingService.CanVoid(order).ShouldBeFalse();
                        }
                    }
                }
            }



            order.PaymentMethodSystemName = "paymentMethodSystemName_that_don't_support_void";
            foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus)))
            {
                foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus)))
                {
                    foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus)))
                    {
                        order.OrderStatus    = os;
                        order.PaymentStatus  = ps;
                        order.ShippingStatus = ss;

                        _orderProcessingService.CanVoid(order).ShouldBeFalse();
                    }
                }
            }
        }
        public void Ensure_order_can_only_be_voided_when_paymentstatus_is_authorized_and_paymentModule_supports_void()
        {
            tempPaymentService.Setup(ps => ps.SupportVoid("paymentMethodSystemName_that_supports_void")).Returns(true);
            tempPaymentService.Setup(ps => ps.SupportVoid("paymentMethodSystemName_that_doesn't_support_void")).Returns(false);

            var order = new Order();

            order.OrderTotal = 1;
            order.PaymentMethodSystemName = "paymentMethodSystemName_that_supports_void";

            foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus)))
            {
                foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus)))
                {
                    foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus)))
                    {
                        order.OrderStatus    = os;
                        order.PaymentStatus  = ps;
                        order.ShippingStatus = ss;

                        if (ps == PaymentStatus.Authorized)
                        {
                            Assert.IsTrue(_orderProcessingService.CanVoid(order));
                        }
                        else
                        {
                            Assert.IsFalse(_orderProcessingService.CanVoid(order));
                        }
                    }
                }
            }

            order.PaymentMethodSystemName = "paymentMethodSystemName_that_doesn't_support_void";
            foreach (OrderStatus os in Enum.GetValues(typeof(OrderStatus)))
            {
                foreach (PaymentStatus ps in Enum.GetValues(typeof(PaymentStatus)))
                {
                    foreach (ShippingStatus ss in Enum.GetValues(typeof(ShippingStatus)))
                    {
                        order.OrderStatus    = os;
                        order.PaymentStatus  = ps;
                        order.ShippingStatus = ss;

                        Assert.IsFalse(_orderProcessingService.CanVoid(order));
                    }
                }
            }
        }
 /// <summary>
 /// Gets a value indicating whether void from admin panel is allowed
 /// </summary>
 /// <param name="order">Order</param>
 /// <returns>A value indicating whether void from admin panel is allowed</returns>
 public bool CanVoid(Order order)
 {
     return(_orderProcessingService.CanVoid(order));
 }