public void CanCreateAndCommentAndDeleteIssues()
        {
            var title = Guid.NewGuid().ToString();
            var body = Guid.NewGuid().ToString();
            var request = new CreateIssueRequest(title, body) { Assignee = "rhysc", Labels = new[] { "Test1", "Test2" } };
            var issue = _issuesRepositoryApi.Create("githubsharp", "rhysc", request);
            Assert.NotNull(issue);
            Assert.AreEqual(title, issue.Title);
            Assert.AreEqual(body, issue.Body);
            Assert.AreEqual(title, issue.Title);
            Assert.True(issue.Labels.Any(l => l.Name == "Test1"));
            Assert.True(issue.Labels.Any(l => l.Name == "Test2"));
            Assert.AreEqual("RhysC", issue.Assignee.Login);

            var comment = Guid.NewGuid().ToString();
            var commentedIsssue = _issuesRepositoryApi.CommentOnIssue("githubsharp", "rhysc", issue.Number, comment);
            Assert.AreEqual(comment, commentedIsssue.Body);

            var closedIssue = _issuesRepositoryApi.Close("githubsharp", "rhysc", issue.Number);
            Assert.NotNull(closedIssue);
            Assert.AreEqual(title, closedIssue.Title);
            Assert.AreEqual(body, closedIssue.Body);
            Assert.AreEqual(title, closedIssue.Title);
            Assert.AreEqual("RhysC", closedIssue.Assignee.Login);
            Assert.AreEqual("closed", closedIssue.State);
            Console.WriteLine("closedat - {0}, Utc Now - {1}", closedIssue.ClosedAt, DateTime.UtcNow);
            Assert.True(DateTime.UtcNow.AddMinutes(-2) < closedIssue.ClosedAt && closedIssue.ClosedAt < DateTime.UtcNow.AddMinutes(2));
        }
 public IssueResponse Create(string repositoryName, string owner, CreateIssueRequest request)
 {
     var url = string.Format("repos/{0}/{1}/issues", owner, repositoryName);
     return ConsumeJsonUrlAndPostData<CreateIssueRequest, IssueResponse>(url, request);
 }