// GET: Product/{id} public ActionResult Product(string id) { if (id != null) { Product p = DalWebshop.Models.Product.Find(id); ViewBag.Product = p; ViewBag.Kortingen = p.RetrieveKorting(); } if (Session["AuthGebruiker"] != null) { Gebruiker g = (Gebruiker)Session["AuthGebruiker"]; ViewBag.CanReview = Recensie.CanReview(Convert.ToInt32(id), g.Id); } else { ViewBag.CanReview = false; } ViewBag.Recensies = DalWebshop.Models.Recensie.FindByProductId(Convert.ToInt32(id)); return(View("~/Views/Product/Product.cshtml")); }
public void CanReveiw() { bool canReview = Recensie.CanReview(17, 1); Assert.IsTrue(canReview); }