public void Ensure_order_can_only_be_partially_refunded_offline_when_paymentstatus_is_paid_or_partiallyRefunded() { var order = new Order { OrderTotal = 100 }; 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; { order.OrderStatus = os; order.PaymentStatus = ps; order.ShippingStatus = ss; if (ps == PaymentStatus.Paid || order.PaymentStatus == PaymentStatus.PartiallyRefunded) { _orderProcessingService.CanPartiallyRefundOffline(order, 10).ShouldBeTrue(); } else { _orderProcessingService.CanPartiallyRefundOffline(order, 10).ShouldBeFalse(); } } } } } }
public void EnsureOrderCanOnlyBePartiallyRefundedOfflineWhenPaymentStatusIsPaidOrPartiallyRefunded() { var order = new Order { OrderTotal = 100 }; 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; { order.OrderStatus = os; order.PaymentStatus = ps; order.ShippingStatus = ss; if (ps == PaymentStatus.Paid || order.PaymentStatus == PaymentStatus.PartiallyRefunded) { _orderProcessingService.CanPartiallyRefundOffline(order, 10).Should().BeTrue(); } else { _orderProcessingService.CanPartiallyRefundOffline(order, 10).Should().BeFalse(); } } } } } }