Пример #1
0
        public void CanRunRemoveCategoryIfCategoryDoesntExist()
        {
            var search = new SearchModel();

            search.AddCategory("Peter.Boyer");

            search.RemoveCategory("Peter.Rabbit");
            Assert.IsNull(search.GetCategoryByName("Peter.Rabbit"));
        }
Пример #2
0
        public void GetCategoryByNameWithValidInput()
        {
            const string catName = "Category.Child";

            search.AddCategory(catName);
            Assert.IsTrue(search.ContainsCategory(catName));
            Assert.AreEqual(1, search.BrowserRootCategories.Count(x => x.Name == "Category"));
            var nestedCat = search.GetCategoryByName("Category.Child");

            Assert.NotNull(nestedCat);
        }