コード例 #1
0
            public void EnsuresNonNullArguments()
            {
                var client = new ObservableProjectColumnsClient(Substitute.For <IGitHubClient>());
                var updateProjectColumn = new ProjectColumnUpdate("someNewName");

                Assert.Throws <ArgumentNullException>(() => client.Update(1, null));
            }
コード例 #2
0
            public void PostsToCorrectURL()
            {
                var gitHubClient        = Substitute.For <IGitHubClient>();
                var client              = new ObservableProjectColumnsClient(gitHubClient);
                var updatePorjectColumn = new ProjectColumnUpdate("someNewName");

                client.Update(1, updatePorjectColumn);

                gitHubClient.Repository.Project.Column.Received().Update(1, updatePorjectColumn);
            }
コード例 #3
0
        public async Task UpdatesColumn()
        {
            var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId);

            var column = await CreateColumnHelper(_github, project.Id);

            var columnUpdate = new ProjectColumnUpdate("newName");

            var result = await _github.Repository.Project.Column.Update(column.Id, columnUpdate);

            Assert.Equal("newName", result.Name);
            Assert.Equal(column.Id, result.Id);
        }
コード例 #4
0
            public async Task PostsToCorrectURL()
            {
                var connection          = Substitute.For <IApiConnection>();
                var client              = new ProjectColumnsClient(connection);
                var updateProjectColumn = new ProjectColumnUpdate("someNewName");

                await client.Update(1, updateProjectColumn);

                connection.Received().Patch <ProjectColumn>(
                    Arg.Is <Uri>(u => u.ToString() == "projects/columns/1"),
                    updateProjectColumn,
                    "application/vnd.github.inertia-preview+json");
            }
コード例 #5
0
        /// <summary>
        /// Updates a column for this project.
        /// </summary>
        /// <remarks>
        /// See the <a href="https://developer.github.com/v3/projects/columns/#update-a-project-column">API documentation</a> for more information.
        /// </remarks>
        /// <param name="id">The id of the column</param>
        /// <param name="projectColumnUpdate">New values to update the column with</param>
        public IObservable <ProjectColumn> Update(int id, ProjectColumnUpdate projectColumnUpdate)
        {
            Ensure.ArgumentNotNull(projectColumnUpdate, "projectColumnUpdate");

            return(_client.Update(id, projectColumnUpdate).ToObservable());
        }