public void InitializeTest()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            this.tracker = new IssueTracker();

            this.issue1 = new Issue(
                "Not possible to practise in judge.", 
                "Judge system is not working. Not possible to log in.", 
                IssuePriority.High, 
                new List<string> { "judge", "softuni" });

            this.issue2 = new Issue(
                "Not possible to practise in judge, again.", 
                "Judge system is not working, again. Not possible to log in.", 
                IssuePriority.Low, 
                new List<string> { "judge", "softuni" });

            this.user1 = new User("Helen", "0123");
            this.user2 = new User("Gosho", "0124");

            this.comment1 = new Comment(
                this.user2, 
                "The system is not working from yesterday, but they made new website and it will take a while till it starts working correctly.");
            this.comment2 = new Comment(this.user1, "Ok, thanks. I heard of that. Hope soon can practice, again.");

            this.issue1.Comments = new List<Comment> { this.comment1, this.comment2 };
        }
        public void InitializeTest()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            this.tracker = new IssueTracker();

            this.issue1 = new Issue(
                "Not possible to practise in judge.",
                "Judge system is not working. Not possible to log in.",
                IssuePriority.High,
                new List<string> { "judge", "softuni" });

            this.user1 = new User("Helen", "0123");

            this.comment1 = new Comment(this.user1, "Can someone answer, please.");
            this.comment2 = new Comment(this.user1, "There is still no answer :(");

            this.issue1.Comments = new List<Comment> { this.comment1, this.comment2 };
        }
示例#3
0
 public void AddComment(Comment comment)
 {
     this.Comments.Add(comment);
 }
        public string AddComment(int issueId, string commentText)
        {
            if (this.Data.CurrentlyLoggedInUser == null)
            {
                return string.Format("There is no currently logged in user");
            }


            if (!this.Data.IssueId_Issue.ContainsKey(issueId))
            {
                return string.Format("There is no issue with ID {0}", issueId);
            }

            var issue = this.Data.IssueId_Issue[issueId];
            var comment = new Comment(this.Data.CurrentlyLoggedInUser, commentText);

            issue.Comments.Add(comment);

            this.Data.UserComments.Add(this.Data.CurrentlyLoggedInUser, comment);

            return string.Format("Comment added successfully to issue {0}", issue.Id);
        }