public ActionResult Index(int id) { try { if (Convert.ToInt32(TempData["Visited"]) != 1) { video.View(id); TempData["visited"] = 1; } TempData["videoid"] = Convert.ToString(id); ViewModel model = new ViewModel(); model.Video = video.GetVideo(id); model.Reactions = reaction.GetReactionsForVideo(id); return(View(model)); } catch (Exception ex) { return(new EmptyResult()); } }
public void GetReactionsForVideo() { // There are 3 videos with id 0 initialized in the memorycontext so this method should return 3 reaction objects Assert.AreEqual(3, reactionrepo.GetReactionsForVideo(0).Count); }