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)); }
public void TestSubmitLike() { _logic.SubmitLike(_build, _account.Id); Assert.IsTrue(_logic.GetLikeFromUser(_build.Id, _account.Id) && !_logic.GetDislikeFromUser(_build.Id, _account.Id)); }