public void TestComment()
        {
            int          bugID = 1001;
            string       commentDescription = "";
            DateTime     commentTimestamp   = DateTime.Now;
            string       commentUsername    = "";
            CommentClass cc = new CommentClass();

            cc.bugID = bugID;
            cc.commentDescription = commentDescription;
            cc.commentTimestamp   = commentTimestamp;
            cc.commentUsername    = commentUsername;


            Assert.AreEqual(cc.addComment(), 0);
        }
示例#2
0
 protected void btnComment_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         CommentClass cc = new CommentClass();
         cc.bugID = Int32.Parse(id);
         cc.commentDescription = commentBox.Text;
         cc.commentUsername    = Session["loginID"].ToString();
         if (cc.addComment() == 0)
         {
             Label3.Text     = "Comment Added.";
             commentBox.Text = "";
             displayComments();
         }
         else
         {
             Label3.Text = "Error submitting your comment. Submit a bug report about this issue.";
         }
     }
 }