// todo: outsource this to StoreSectionFixture
        private IEnumerable <IStoreSection> CreateValidSections(int sectionAmount)
        {
            List <IStoreSection> sections = storeSectionFixture
                                            .CreateMany(StoreSectionDefinition.FromIsDefaultSection(false), sectionAmount - 1)
                                            .ToList();
            IEnumerable <int> otherSectionIds = sections.Select(s => s.Id.Value);

            int defaultSectionId         = commonFixture.NextUniqueInts(1, otherSectionIds).First();
            var defaultSectionDefinition = new StoreSectionDefinition()
            {
                Id = new SectionId(defaultSectionId),
                IsDefaultSection = true
            };
            IStoreSection defaultSection = storeSectionFixture.Create(defaultSectionDefinition);

            sections.Add(defaultSection);
            sections.Shuffle();

            return(sections);
        }
 public static StoreItemAvailabilityReadModel ToReadModel(this IStoreItemAvailability model, IStore store,
                                                          IStoreSection section)
 {
     return(new StoreItemAvailabilityReadModel(store.ToStoreItemStoreReadModel(), model.Price,
                                               section.ToReadModel()));
 }
 public static StoreSectionReadModel ToReadModel(this IStoreSection model)
 {
     return(new StoreSectionReadModel(model.Id, model.Name, model.SortingIndex, model.IsDefaultSection));
 }
 public IShoppingListSection CreateEmpty(IStoreSection storeSection)
 {
     return new ShoppingListSection(storeSection.Id, Enumerable.Empty<IShoppingListItem>());
 }