private static void CheckStatus(Profile profile) { if (profile.Status != UserStatus.Active) throw new UnauthorizedAccessException("Profile is inactive."); }
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 } }; }
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 } }; }
public Profile Update(Profile profile) { _session.SaveOrUpdate(profile); return profile; }