public void CanAddCategoryWithDelimiters() { var model = new SearchViewModel(); var leaf = model.AddCategory("Peter.Boyer"); model.RemoveCategory("Peter.Boyer"); }
public void CanRunRemoveCategoryIfCategoryDoesntExist() { var search = new SearchViewModel(); search.AddCategory("Peter.Boyer"); search.RemoveCategory("Peter.Rabbit"); Assert.IsNull(search.GetCategoryByName("Peter.Rabbit")); }
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); }