Пример #1
0
        public IShoppingList CreateValidWith(ShoppingListItemDefinition itemDefinition)
        {
            var sections = shoppingListSectionFixture.CreateManyValid().ToList();
            var section  = shoppingListSectionFixture.CreateValidWith(itemDefinition);

            sections.Add(section);

            var listDef = new ShoppingListDefinition
            {
                Sections = sections
            };

            return(CreateValid(listDef));
        }
        public IShoppingListSection CreateValidWith(ShoppingListItemDefinition itemDefinition)
        {
            // todo: check for ItemId
            var items = shoppingListItemFixture.CreateManyValid().ToList();
            var item  = shoppingListItemFixture.CreateValid(itemDefinition);

            items.Add(item);

            var sectionDef = new ShoppingListSectionDefinition
            {
                Items = items
            };

            return(CreateValid(sectionDef));
        }