Exemple #1
0
        public async Task GetGitRepositoriesTestAsync()
        {
            var repositories = await client.GetGitRepositoriesAsync(projectId);

            Assert.AreNotEqual(repositories[0].Id, 0L);
            Assert.AreEqual(repositories[0].ProjectId, projectId);

            var repository = await client.GetGitRepositoryAsync(projectId, repositories[0].Id);

            Assert.AreEqual(repository.Id, repositories[0].Id);

            repository = JsonConvert.DeserializeObject <Repository>(File.ReadAllText(@"TestData\repository.json"), new RepositoryJsonImpl.JsonConverter());
            Assert.AreEqual(repository.Id, 16272L);
            Assert.AreEqual(repository.ProjectId, 61932L);
            Assert.AreEqual(repository.Name, "test");
            Assert.AreEqual(repository.Description, "test-description");
            Assert.AreEqual(repository.HookUrl, "test-hook-url");
            Assert.AreEqual(repository.HttpUrl, "https://test-4net.backlog.jp/git/BLG4NT/test.git");
            Assert.AreEqual(repository.SshUrl, "[email protected]:/BLG4NT/test.git");
            Assert.AreEqual(repository.DisplayOrder, 2147483646L);
            Assert.AreEqual(repository.PushedAt, new DateTime(2017, 8, 20, 10, 29, 8, DateTimeKind.Utc));
            Assert.AreEqual(repository.CreatedUser.Id, 137752L);
            Assert.AreEqual(repository.Created, new DateTime(2017, 8, 20, 10, 25, 48, DateTimeKind.Utc));
            Assert.AreEqual(repository.UpdatedUser.Id, 137752L);
            Assert.AreEqual(repository.Updated, new DateTime(2017, 8, 20, 10, 25, 48, DateTimeKind.Utc));
        }
        public async Task AddStarToPullRequestAndCommentTestAsync()
        {
            var gitrepos = await client.GetGitRepositoriesAsync(projectId);

            var pullRequests = await client.GetPullRequestsAsync(projectId, gitrepos.First().Id);

            await client.AddStarToPullRequestAsync(pullRequests.First().Id);

            var pullRequestComments = await client.GetPullRequestCommentsAsync(projectId, gitrepos.First().Id, pullRequests.First().Number, new QueryParams()
            {
            });

            await client.AddStarToPullRequestCommentAsync(pullRequestComments.First().Id);
        }