コード例 #1
0
        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 };
        }
コード例 #2
0
        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 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
ファイル: Comment.cs プロジェクト: ikolev94/Exercises
 public Comment(User author, string text)
 {
     this.Author = author;
     this.Text = text;
 }
コード例 #5
0
ファイル: Comment.cs プロジェクト: EBojilova/CSharpHQC
 public Comment(User commentAuthor, string commentText)
 {
     this.CommentAuthor = commentAuthor;
     this.CommentText = commentText;
 }