internal static void AssertEqual(this ShipmentInformation expected, ISetShipmentInformation setShipmentInformation, ShippingLabel soldTo = null) { if (expected == null) { throw new ArgumentNullException("expected"); } if (setShipmentInformation == null) { Assert.AreEqual(ShipmentStatus.Unscheduled, expected.Status); Assert.AreEqual(0.0, expected.PalletWeight); Assert.AreEqual(0, expected.PalletQuantity); Assert.IsNull(expected.InternalNotes); Assert.IsNull(expected.ExternalNotes); Assert.IsNull(expected.SpecialInstructions); expected.AssertEqual((ISetTransitInformation)null); expected.AssertEqual((ISetShippingInstructions)null, soldTo); } else { Assert.AreEqual(setShipmentInformation.PalletWeight, expected.PalletWeight); Assert.AreEqual(setShipmentInformation.PalletQuantity, expected.PalletQuantity); expected.AssertEqual(setShipmentInformation.TransitInformation); expected.AssertEqual(setShipmentInformation.ShippingInstructions, soldTo); } }
internal static void AssertEqual(this ISetShipmentInformation expected, ShipmentInformation result, ShippingLabel soldTo = null) { expected = expected ?? new SetShipmentInformationWithStatus(); Assert.AreEqual(expected.PalletWeight, result.PalletWeight); Assert.AreEqual(expected.PalletQuantity, result.PalletQuantity); expected.ShippingInstructions.AssertEqual(result, soldTo); expected.TransitInformation.AssertEqual(result); }
internal IResult <ShipmentInformation> Execute(DateTime dateCreated, ISetShipmentInformation shipment) { if (dateCreated == null) { throw new ArgumentNullException("dateCreated"); } var createResult = Execute(dateCreated); if (!createResult.Success) { return(createResult); } createResult.ResultingObject.SetShipmentInformation(shipment); return(createResult); }
internal static void SetShipmentInformation(this ShipmentInformation shipmentInformation, ISetShipmentInformation shipment, bool setShipFrom = true) { if (shipmentInformation == null) { throw new ArgumentNullException("shipmentInformation"); } if (shipment == null) { shipmentInformation.Status = ShipmentStatus.Unscheduled; shipmentInformation.PalletWeight = null; shipmentInformation.PalletQuantity = 0; shipmentInformation.ExternalNotes = null; shipmentInformation.InternalNotes = null; shipmentInformation.SpecialInstructions = null; shipmentInformation.SetShippingInstructions(null, setShipFrom); shipmentInformation.SetTransitInformation((ISetTransitInformation)null); } else { shipmentInformation.PalletWeight = shipment.PalletWeight; shipmentInformation.PalletQuantity = shipment.PalletQuantity; shipmentInformation.SetShippingInstructions(shipment.ShippingInstructions, setShipFrom); shipmentInformation.SetTransitInformation(shipment.TransitInformation); } }