Example #1
0
        public JsonResult GetCategoryName(string id)
        {
            CategoryRepo repo = new CategoryRepo();
            string category = repo.GetCategory(id);

            return Json(category, JsonRequestBehavior.AllowGet);
        }
Example #2
0
        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);
        }