public void TestDetailsViewData()
 {
     int _id = 2;
     HomeController _controller = new HomeController();
     Product _expected = new Product { Id = _id, Name = "Data" };
      _controller.Details(_id).AssertViewRendered().WithViewData<Product>().ShouldEqual(_expected,"TestDetailsViewData");
 }
 public void TestDetailsViewData()
 {
     HomeController _controller = new HomeController();
     ViewResult _result = _controller.Details(0);
     Product _item = _result.ViewData.Model as Product;
     Assert.AreEqual(_item.Name, "Data");
 }
        public void TestDetailsRedirect()
        {
            HomeController _controller = new HomeController();
            RedirectToRouteResult _result = _controller.Category(-1) as RedirectToRouteResult;

            Assert.AreEqual("Index",_result.RouteValues["action"]);
        }
 public void TestDetailsReturnsView()
 {
     HomeController _controller = new HomeController();
     _controller.Details(2).AssertViewRendered().ForView("Details");
 }
 public void TestDetailsRedirect()
 {
     HomeController _controller = new HomeController();
     _controller.Category(-1).AssertActionRedirect().ToAction("Index");
 }
 public void TestDetailsReturnsView()
 {
     HomeController _controller = new HomeController();
     ViewResult _result = _controller.Details(0);
     Assert.AreEqual(_result.ViewName, "Details");
 }