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 };
        }
        public string RegisterUser(string username, string password, string confirmPassword)
        {
            if (this.Data.CurrentlyLoggedInUser != null)
            {
                return "There is already a logged in user";
            }

            if (password != confirmPassword)
            {
                return "The provided passwords do not match";
            }

            var isUsernameFree = this.Data.UserName_User.All(u => u.Value.Name != username);

            if (!isUsernameFree)
            {
                return string.Format("A user with username {0} already exists", username);
            }

            var user = new User(username, password);
            this.Data.UserName_User.Add(user.Name, user);

            return string.Format("User {0} registered successfully", username);
        }
示例#4
0
 public Comment(User author, string text)
 {
     this.Author = author;
     this.Text = text;
 }
示例#5
0
 public Comment(User commentAuthor, string commentText)
 {
     this.CommentAuthor = commentAuthor;
     this.CommentText = commentText;
 }