コード例 #1
0
 public ActionResult AddUpVote(int PlayHistoryId)
 {
     using (var context = new Uow(this.context))
     {
         var        repos   = new RepositoryVote(context);
         AuthHelper _ah     = new AuthHelper(context);
         var        _userId = _ah.SetupUser();
         repos.UpVote(PlayHistoryId);
         Success("Vote", "Save successful.");
         return(Redirect(Request.UrlReferrer.ToString()));
     }
 }
コード例 #2
0
 public void Up(int id)
 {
     _vote.UpVote(id);
 }
コード例 #3
0
 public void ShouldUpVoteTrack()
 {
     repos.UpVote(2);
     Assert.IsTrue(context.Object.Votes.Count(i => i.PlayHistoryId == 2 && i.VoteValue) == 1);
 }