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");
 }
Esempio n. 2
0
 public ViewResult Details(int Id)
 {
     Product _item = new Product{Id=Id, Name="Data"};
     return View("Details",_item);
 }
Esempio n. 3
0
 public ActionResult Category(int Id)
 {
     if (Id < 0) { return RedirectToAction("Index"); }
     Product _item = new Product { Id = Id, Name = "Data" };
     return View("Details", _item);
 }