예제 #1
0
        public void TestGetMyIssues_NoUser()
        {
            IIssueTracker tracker = new FakeIssueTrackerWithNoUser();

            string actualResult   = tracker.GetMyIssues();
            string expectedResult = "There is no currently logged in user";

            Assert.AreEqual(expectedResult, actualResult,
                            "GetMyIssues() does not show proper output in case of no logged in user.");
        }
예제 #2
0
        public void TestRegisterUser_PasswordsDoNotMatch()
        {
            IIssueTracker tracker         = new FakeIssueTrackerWithNoUser();
            string        username        = "******";
            string        password        = "******";
            string        confirmPassword = "******";

            string result = tracker.RegisterUser(username, password, confirmPassword);

            Assert.AreEqual(result, "The provided passwords do not match",
                            "RegisterUser() does not return proper outcome in case of pasword mismatch.");
        }
예제 #3
0
        public void TestRegisterUser_ExistingUser()
        {
            IIssueTracker tracker         = new FakeIssueTrackerWithNoUser();
            string        username        = "******";
            string        password        = "******";
            string        confirmPassword = "******";

            tracker.RegisterUser(username, password, confirmPassword);
            string result = tracker.RegisterUser(username, password, confirmPassword);

            Assert.AreEqual(result, "A user with username pesho already exists",
                            "RegisterUser() does not return proper outcome in case of duplicate user.");
        }
예제 #4
0
        public void TestCreateIssue_NoLoggedInUser()
        {
            IIssueTracker tracker = new FakeIssueTrackerWithNoUser();

            string        title       = "title";
            string        description = "description";
            IssuePriority priority    = (IssuePriority)Enum.Parse(typeof(IssuePriority), "low");

            string[] tags = new string[] { "new", "issue", "another" };

            string result = tracker.CreateIssue(title, description, priority, tags);

            Assert.AreEqual(result, "There is no currently logged in user",
                            "CreateIssue() does not return proper outcome in case of no logged in user.");
        }