コード例 #1
0
        public void shouldReplyTweet(TweetCommentsModel comment)
        {
            TweetCommentsModel tweetCommentsModel = new TweetCommentsModel();

            tweetCommentsModel.tweetId = "";
            tweetCommentsModel.userId  = "";

            var result = _tweetService.ReplyTweet(comment);

            Assert.IsTrue(result);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public bool Create(TweetCommentsModel tweetComment)
        {
            bool isCreated = false;

            try
            {
                _tweetCommentsData.InsertOne(tweetComment);
                isCreated = true;
            }
            catch (Exception)
            {
                throw;
            }
            return(isCreated);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 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"));
 }