public static List <Occurrence> SetupOccurrenceSearchMultipleOccurrences(ComputerSystem kiosk) { List <Occurrence> occurrences = new List <Occurrence>(); var occurrence = SetupOccurrenceSearch(kiosk); occurrences.Add(occurrence); var location = CheckInTestFactories.CreateLocation(); location.OccurrenceTypes.Add(occurrence.OccurrenceType); location.Save(CheckInTestConstants.USER_ID); occurrence.OccurrenceType.Locations.Add(location); occurrence.OccurrenceType.Save(CheckInTestConstants.USER_ID); kiosk.Locations.Add(location); kiosk.Save(); kiosk.SaveLocations(new[] { location.LocationId }); var newOccurrence = CheckInTestFactories.CreateOccurrence(); newOccurrence.OccurrenceTypeID = occurrence.OccurrenceTypeID; newOccurrence.StartTime = occurrence.StartTime; newOccurrence.LocationID = location.LocationId; newOccurrence.Save(CheckInTestConstants.USER_ID); occurrences.Add(newOccurrence); return(occurrences); }
public static Occurrence SetupOccurrenceSearch(ComputerSystem kiosk) { const string userID = CheckInTestConstants.USER_ID; var occurrence = CheckInTestFactories.CreateOccurrence(); var type = CheckInTestFactories.CreateOccurrenceType(); var group = CheckInTestFactories.CreateOccurrenceTypeGroup(); group.Save(userID); type.GroupId = group.GroupId; type.Save(userID); group.OccurrenceTypes.Add(type); group.Save(userID); occurrence.OccurrenceTypeID = type.OccurrenceTypeId; occurrence.Save(userID); type.Occurrences.Add(occurrence); type.Save(userID); var location = CheckInTestFactories.CreateLocation(); location.OccurrenceTypes.Add(type); location.Save(userID); occurrence.LocationID = location.LocationId; occurrence.Save(userID); type.Locations.Add(location); type.Save(userID); kiosk.Locations.Add(location); kiosk.Save(); kiosk.SaveLocations(new[] { location.LocationId }); return(occurrence); }