示例#1
0
        //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>));
        }
示例#2
0
        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());
        }
示例#3
0
        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);
            }
        }