public void LikesLikeShouldReturnOkResult() { var controller = new LikesController(this.likeService, this.userService); var result = controller.Like(1); Assert.IsNotNull(result); }
private string LikePost() { int userId = 0; int contentId = 0; if (Params.ContainsKey("userId") && SimulateIsNumeric.IsNumeric(Params["userId"])) { userId = int.Parse(Params["userId"].ToString()); } if (Params.ContainsKey("contentId") && SimulateIsNumeric.IsNumeric(Params["contentId"])) { contentId = int.Parse(Params["contentId"].ToString()); } var likeController = new LikesController(); likeController.Like(contentId, UserId); return(BuildOutput(userId + "|" + contentId, OutputCodes.Success, true)); }
private string LikePost() { int userId = 0; int contentId = 0; if (Params.ContainsKey("userId") && SimulateIsNumeric.IsNumeric(Params["userId"])) { userId = int.Parse(Params["userId"].ToString()); } if (Params.ContainsKey("contentId") && SimulateIsNumeric.IsNumeric(Params["contentId"])) { contentId = int.Parse(Params["contentId"].ToString()); } var likeController = new LikesController(); likeController.Like(contentId, UserId); return BuildOutput(userId + "|" + contentId, OutputCodes.Success, true); }