public void Test_CreateIssues_CorrectParameters_ShouldCreateIssues() { var tracker = new GithubIssueTracker(new GithubIssueTrackerData()); tracker.RegisterUser("Ivan", "qwerty", "qwerty"); tracker.LoginUser("Ivan", "qwerty"); string firstMessage = tracker.CreateIssue("Not working comments", "Comments functionnality does not work", IssuePriority.High, new[] { "comment" }); string secondMessage = tracker.CreateIssue("Not working issues", "Issues functionnality does not work", IssuePriority.High, new[] { "issue" }); Assert.AreEqual("Issue 1 created successfully", firstMessage); Assert.AreEqual("Issue 2 created successfully", secondMessage); }
public void Test_CreateIssue_NotLoggedUser_ShouldReturnErrorMessage() { var tracker = new GithubIssueTracker(new GithubIssueTrackerData()); string message = tracker.CreateIssue("Not working comments", "Comments functionnality does not work", IssuePriority.High, new[] { "comments" }); Assert.AreEqual("There is no currently logged in user", message); }
public void Test_CreateIssue_InvalidDescription_ShouldReturnException() { var tracker = new GithubIssueTracker(new GithubIssueTrackerData()); tracker.RegisterUser("Ivan", "qwerty", "qwerty"); tracker.LoginUser("Ivan", "qwerty"); tracker.CreateIssue("Not working comments", "aaaa", IssuePriority.High, new[] { "comment" }); }
public void Test_CreateIssue_InvalidTitle_ShouldReturnException() { var tracker = new GithubIssueTracker(new GithubIssueTrackerData()); tracker.RegisterUser("Ivan", "qwerty", "qwerty"); tracker.LoginUser("Ivan", "qwerty"); tracker.CreateIssue("aa", "Comments functionnality does not work", IssuePriority.High, new[] { "comment" }); }
public void Test_GetMyIssues_SomeIssues_SortByTitle_ShouldReturnIssues() { 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" }); string message = tracker.GetMyIssues(); Assert.AreEqual( "New issue1\r\n" + "Priority: ***\r\n" + "This is a new issue1\r\n" + "Tags: issue1\r\n" + "New issue2\r\n" + "Priority: ***\r\n" + "This is a new issue2\r\n" + "Tags: issue2", message); }
public void Test_SearchForIssues_SomeIssues_SortByTitle_ShouldReturnIssues() { var tracker = new GithubIssueTracker(new GithubIssueTrackerData()); tracker.RegisterUser("Ivan", "qwerty", "qwerty"); tracker.LoginUser("Ivan", "qwerty"); tracker.CreateIssue("Some issue", "This is a new issue", IssuePriority.High, new[] { "issue" }); tracker.CreateIssue("New issue error", "This is a new issue error", IssuePriority.High, new[] { "issue", "issue_error" }); string message = tracker.SearchForIssues(new[] { "issue" }); Assert.AreEqual( "New issue error\r\n" + "Priority: ***\r\n" + "This is a new issue error\r\n" + "Tags: issue,issue_error\r\n" + "Some issue\r\n" + "Priority: ***\r\n" + "This is a new issue\r\n" + "Tags: issue", message); }
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); }
public void Test_SearchForIssues_NoMatchingTags_ShouldReturnNoIssues() { var tracker = new GithubIssueTracker(new GithubIssueTrackerData()); tracker.RegisterUser("Ivan", "qwerty", "qwerty"); tracker.LoginUser("Ivan", "qwerty"); tracker.CreateIssue("Some issue", "This is a new issue", IssuePriority.High, new[] { "issue" }); tracker.CreateIssue("New issue error", "This is a new issue error", IssuePriority.High, new[] { "issue", "issue_error" }); string message = tracker.SearchForIssues(new[] { "comment_issue" }); Assert.AreEqual("There are no issues matching the tags provided", message); }