Пример #1
0
        public void ReturnsCategoryAndItsSubcategoriesAndProducts(int id)
        {
            var result = controller.Category(id, null, null);

            var expected = new CategoryPageDTO
            {
                Category      = categoriesRepository.GetCategory(id),
                Subcategories = categoriesRepository.GetSubcategoriesForCategory(id),
                Products      = categoriesRepository.GetProductsForCategory(id)
            };

            Assert.Equal(JsonConvert.SerializeObject(expected),
                         JsonConvert.SerializeObject(result));
        }