public void OrderStatusDraft_ExceptionThrown() { var shipment = new ShipmentBuilder().Build(); var purchaseOrder = new PurchaseOrderBuilder().Build(); Assert.Throws <PurchaseOrderTrackerException>(() => shipment.AddPurchaseOrder(purchaseOrder)); }
public void OrderStatusPendingApproval_ExceptionThrown() { var shipment = new ShipmentBuilder().Build(); var purchaseOrder = new PurchaseOrderBuilder().Build(); purchaseOrder.UpdateStatus(PurchaseOrderStatus.Trigger.PendingApproval); Assert.Throws <PurchaseOrderTrackerException>(() => shipment.AddPurchaseOrder(purchaseOrder)); }
public void OrderAlreadyAssignedToShipment_ExceptionThrown() { var shipment = new ShipmentBuilder().ShipmentId(123).Build(); var poShipment = new ShipmentBuilder().ShipmentId(789).Build(); var purchaseOrder = new PurchaseOrderBuilder().Shipment(poShipment).Build(); purchaseOrder.UpdateStatus(PurchaseOrderStatus.Trigger.Approved); Assert.Throws <PurchaseOrderTrackerException>(() => shipment.AddPurchaseOrder(purchaseOrder)); }
public void OrderStatusIsApproved_OrderAdded() { var shipment = new ShipmentBuilder().Build(); var purchaseOrder = new PurchaseOrderBuilder().Build(); purchaseOrder.UpdateStatus(PurchaseOrderStatus.Trigger.Approved); shipment.AddPurchaseOrder(purchaseOrder); Assert.That(shipment.PurchaseOrders.Contains(purchaseOrder), Is.True); }