public void test_category_menu() { var controller = new StoreController(new CategoryBLL(new CategoryStub()), new ProductBLL(new ProductStub())); var list = new List<Category>(); var cat = new Category() { CategoryId = 1, Name = "HelloMon" }; list.Add(cat); list.Add(cat); list.Add(cat); var result = (PartialViewResult)controller.CategoryMenu(); var resultList = (List<Category>)result.Model; Assert.AreEqual(result.ViewName, ""); for (var i = 0; i < resultList.Count; i++) { Assert.AreEqual(list[i].CategoryId, resultList[i].CategoryId); Assert.AreEqual(list[i].Name, resultList[i].Name); } }