Ejemplo n.º 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>));
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 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);
            }
        }