//Todo rename test methods for clear description public void TestMethod1() { RepoProvider repo = new RepoProvider(); var testResult = repo.GetCategoryWithProducts("Cars"); Assert.IsInstanceOfType(testResult, typeof(IEnumerable <Category>)); }
public ActionResult Cars() { var cars = _repoProvider.GetCategoryWithProducts("Cars"); //Todo bind with a viewModel for compile time validation. ViewBag.cat = cars.FirstOrDefault(); ViewBag.Message = "Your chosen car details."; return(View()); }
public void TestMethod2() { string inputCategory = "Cars"; RepoProvider repo = new RepoProvider(); var testResult = repo.GetCategoryWithProducts(inputCategory); foreach (var item in testResult) { Assert.AreEqual <string>(item.CategoryName, inputCategory); } }