public IActionResult Detail(string buildId) { PcBuildDetailViewModel model = new PcBuildDetailViewModel { Build = _pcBuildLogic.GetBuild(buildId), Account = _pcBuildLogic.GetUserFromBuild(buildId) }; if (User.Identity is ClaimsIdentity claimsIdentity && User.Identity.IsAuthenticated) { var userId = GetUserId(); model.Liked = _likeLogic.GetLikeFromUser(buildId, userId); model.Disliked = _likeLogic.GetDislikeFromUser(buildId, userId); } model.Build.Id = buildId; return(View(model)); }
public void TestSubmitLike() { _logic.SubmitLike(_build, _account.Id); Assert.IsTrue(_logic.GetLikeFromUser(_build.Id, _account.Id) && !_logic.GetDislikeFromUser(_build.Id, _account.Id)); }