public void TestDetailsViewData()
 {
     ProductController controller = new ProductController(); // TODO: Initialize to an appropriate value
     ViewResult result = controller.Details(2) as ViewResult;
     Product product = result.ViewData.Model as Product;
     Assert.AreEqual("Test", product.Name);
 }
        public void DetailsViewTest()
        {
            ProductController controller = new ProductController(); // TODO: Initialize to an appropriate value
            ViewResult result = controller.Details(2) as ViewResult;

            Assert.AreEqual("Details", result.ViewName);
        }
 public void TestDetailsViewRedirect()
 {
     ProductController controller = new ProductController(); // TODO: Initialize to an appropriate value
     RedirectToRouteResult result = controller.Details(-1) as RedirectToRouteResult;
     Assert.AreEqual("Index", result.RouteValues["action"]);
 }