public void CanAddCategory() { CategoryRepo repo = new CategoryRepo(); var preAddCount = repo.GetAllCategories().Count; string category = "Unit Test"; repo.AddCategory(category); var categories = repo.GetAllCategories(); var postAddCount = categories.Count; Assert.AreEqual(preAddCount + 1, postAddCount); Assert.AreEqual(categories.Last().CategoryName, category); }
public void CanGetCategory() { CategoryRepo repo = new CategoryRepo(); var categories = repo.GetAllCategories(); var category1 = categories.First().CategoryName; var category2 = repo.GetCategory("1"); Assert.AreEqual(category1,category2); }