示例#1
0
        public void CanAddCategoryWithDelimiters()
        {
            var model = new SearchViewModel();
            var leaf  = model.AddCategory("Peter.Boyer");

            model.RemoveCategory("Peter.Boyer");
        }
示例#2
0
文件: Search.cs 项目: l2obin/Dynamo
        public void CanRunRemoveCategoryIfCategoryDoesntExist()
        {
            var search = new SearchViewModel();

            search.AddCategory("Peter.Boyer");

            search.RemoveCategory("Peter.Rabbit");
            Assert.IsNull(search.GetCategoryByName("Peter.Rabbit"));
        }
示例#3
0
文件: Search.cs 项目: l2obin/Dynamo
        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);
        }