public void shouldReplyTweet(TweetCommentsModel comment) { TweetCommentsModel tweetCommentsModel = new TweetCommentsModel(); tweetCommentsModel.tweetId = ""; tweetCommentsModel.userId = ""; var result = _tweetService.ReplyTweet(comment); Assert.IsTrue(result); }
public bool Update(TweetCommentsModel tweetComment) { bool isUpdated = false; try { _tweetCommentsData.ReplaceOne(x => x.commentId.Equals(tweetComment.commentId), tweetComment); isUpdated = true; } catch (Exception) { throw; } return(isUpdated); }
public bool Create(TweetCommentsModel tweetComment) { bool isCreated = false; try { _tweetCommentsData.InsertOne(tweetComment); isCreated = true; } catch (Exception) { throw; } return(isCreated); }
public bool ReplyTweet(TweetCommentsModel comment) { bool isCreated = false; try { comment.createdAt = DateTime.Now; isCreated = _commentRepository.Create(comment); } catch (Exception ex) { string msg = ex.Message; isCreated = false; } return(isCreated); }
public JsonResult ReplyTweet([FromBody] TweetCommentsModel addComment) { try { bool creationStatus = _tweetService.ReplyTweet(addComment); if (creationStatus) { return(new JsonResult("Tweet replied successfully")); } } catch (Exception ex) { string message = "Meesage : " + ex.Message + " & Stacktrace: " + ex.StackTrace; } return(new JsonResult("Error")); }