private static void SetupExpectedObjects() { _expectedDelieryItem = new DeliveryItem { Id = _existingDeliveryItem.Id, ItemType = _existingDeliveryItem.ItemType, Status = DeliveryItemStatus.Delivered, }; _expectedDelivery = new Delivery { Id = _existingDelivery.Id, CompletedOn = _existingDelivery.CompletedOn, Destination = _existingDelivery.Destination, Items = new List<DeliveryItem> { _expectedDelieryItem } }; _expectedProfileToUpdate = new Profile { Id = ProfileId, Items = new List<DeliveryItem> { _expectedDelieryItem }, Deliveries = new List<Delivery> { _expectedDelivery } }; }
private static void HandleFailCases(DeliveryItem deliveryItem) { if (deliveryItem == null) throw new Exception("That delivery item does not exist."); if (deliveryItem.Status == DeliveryItemStatus.Delivered) throw new Exception("That delivery item has already been delivered."); }