public JsonResult GetCategoryName(string id) { CategoryRepo repo = new CategoryRepo(); string category = repo.GetCategory(id); return Json(category, JsonRequestBehavior.AllowGet); }
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); }