Esempio n. 1
0
        public IActionResult ChangeLikeStatus(PcBuildDetailViewModel viewModel)
        {
            var userId = GetUserId();

            if (viewModel.Liked)
            {
                _likeLogic.SubmitLike(viewModel.Build, userId);
            }
            else
            {
                _likeLogic.SubmitDislike(viewModel.Build, userId);
            }

            return(RedirectToAction("Detail", viewModel.Build.Id));
        }
Esempio n. 2
0
 public void TestSubmitLike()
 {
     _logic.SubmitLike(_build, _account.Id);
     Assert.IsTrue(_logic.GetLikeFromUser(_build.Id, _account.Id) && !_logic.GetDislikeFromUser(_build.Id, _account.Id));
 }