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 PersistDeliveries(ISession session, List<DeliveryItem> listOfDeliveredItems)
        {
            d1 = new Delivery
                     {
                         CompletedOn = new DateTime(2010, 5, 4),
                         Destination = byron,
                         Items = listOfDeliveredItems.GetRange(0,3),
                     };
            session.Save(d1);

            d2 = new Delivery
                     {
                         CompletedOn = new DateTime(2010, 3, 2),
                         Destination = roger,
                         Items = listOfDeliveredItems.GetRange(2, 2),
                     };
            session.Save(d2);
        }
        public IProcessEventResponse Process(IEvent @event)
        {
            var profile = _profileRepository.Get(@event.AuthKey);

            var deliveryRequest = @event as NewDeliveryEvent;

            var newDelivery = new Delivery
                                  {
                                      CompletedOn = deliveryRequest.CompletedOn,
                                      Location = deliveryRequest.Location,
                                  };

            profile.Deliveries.Add(newDelivery);

            var updatedProfile = _profileRepository.Update(profile);
            var updatedDelivery = updatedProfile.Deliveries.Last();

            return new DeliveryAddedResponse
                       {
                           DeliveryId = updatedDelivery.Id,
                       };
        }
        private static void SetupExpectedObjects()
        {
            _expectedDelivery = new Delivery
                                    {
                                        Id = _existingDelivery.Id,
                                        CompletedOn = _existingDelivery.CompletedOn,
                                        Destination = _existingDelivery.Destination,
                                        Breadcrumbs = new List<LocationMarker>
                                                                  {
                                                                      _newLocation
                                                                  }
                                    };

            _expectedProfileToUpdate = new Profile
                                           {
                                               Id = ProfileId,
                                               Deliveries = new List<Delivery>
                                                                {
                                                                    _expectedDelivery
                                                                }
                                           };
        }