private void Yes_Click(object sender, RoutedEventArgs e)
        {
            var     tag       = (sender as Button).Tag;
            long    commentId = (long)tag;
            Comment comment   = CommentDB.GetComment(commentId);

            foreach (Comment comm in ViewUserTask.comments)
            {
                if (comm.CommentId == commentId)
                {
                    ViewUserTask.comments.Remove(comm);
                    break;
                }
            }
            CommentDB.RemoveComment(commentId);
            RemovePopup.IsOpen = false;
        }
 public Comment GetComment(int id)
 {
     return(CommentDB.GetComment(id));
 }
示例#3
0
 public Comment GetComment(Guid id)
 {
     return(CommentDB.GetComment(id));
 }
        public void GetCommentFailed()
        {
            int id = 100;

            Assert.IsNull(CommentDB.GetComment(id));
        }
        public void GetCommentSuccess()
        {
            int id = CommentDB.GetCommentsByPostId(active, 3)[0].Id;

            Assert.IsNotNull(CommentDB.GetComment(id));
        }
        public void GetCommentFailed()
        {
            Guid id = Guid.NewGuid();

            Assert.IsNull(CommentDB.GetComment(id));
        }