Exemple #1
0
        public void Test_GetMyIssues_SingleIssue_ShouldReturnIssues()
        {
            var tracker = new GithubIssueTracker(new GithubIssueTrackerData());
            tracker.RegisterUser("Ivan", "qwerty", "qwerty");
            tracker.LoginUser("Ivan", "qwerty");

            tracker.CreateIssue("New issue", "This is a new issue", IssuePriority.High, new[] { "issue" });
            string message = tracker.GetMyIssues();

            Assert.AreEqual(
                "New issue\r\n" +
                "Priority: ***\r\n" +
                "This is a new issue\r\n" +
                "Tags: issue",
                message);
        }
Exemple #2
0
        public void Test_GetMyIssues_NoIssues_ShouldReturnNoIssuesMessage()
        {
            var tracker = new GithubIssueTracker(new GithubIssueTrackerData());
            tracker.RegisterUser("Ivan", "qwerty", "qwerty");
            tracker.LoginUser("Ivan", "qwerty");
            string message = tracker.GetMyIssues();

            Assert.AreEqual("No issues", message);
        }
Exemple #3
0
        public void Test_GetMyIssues_NotLogged_ShouldReturnErrorMessage()
        {
            var tracker = new GithubIssueTracker(new GithubIssueTrackerData());
            tracker.RegisterUser("Ivan", "qwerty", "qwerty");
            tracker.LoginUser("Ivan", "qwerty");

            tracker.CreateIssue("New issue2", "This is a new issue2", IssuePriority.High, new[] { "issue2" });
            tracker.CreateIssue("New issue1", "This is a new issue1", IssuePriority.High, new[] { "issue1" });
            tracker.LogoutUser();
            string message = tracker.GetMyIssues();

            Assert.AreEqual("There is no currently logged in user", message);
        }