public void EnsuresNonNullArguments() { var client = new ObservableProjectColumnsClient(Substitute.For <IGitHubClient>()); var updateProjectColumn = new ProjectColumnUpdate("someNewName"); Assert.Throws <ArgumentNullException>(() => client.Update(1, null)); }
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); }
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); }
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"); }
/// <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()); }