Beispiel #1
0
        public void ShouldGetCategoriesEnumerationFlatten()
        {
            var categories = HierarchicalDatasetProvider.Seed();

            Assert.True(
                categories.Flatten(
                    category => category.Child)
                .Any());
        }
Beispiel #2
0
        public void ShoulReturnProperCategoriesForLevels()
        {
            //proper level of categories nesting
            var repository = new CategoriesRepository(HierarchicalDatasetProvider.Seed());

            Assert.True(
                repository.CategoryNthLevel(1)
                .Select(x => x.Level)
                .Distinct()
                .First() == 1);
        }
Beispiel #3
0
        public void ShoulReturnTopLevelCategories()
        {
            var repository = new CategoriesRepository(HierarchicalDatasetProvider.Seed());

            Assert.True(repository.CategoryNthLevel(1).Any());
        }