/// <summary> /// Updates a milestone for the specified repository. Any user with pull access to a repository can create a /// Milestone. /// </summary> /// <remarks>http://developer.github.com/v3/issues/milestones/#update-a-milestone</remarks> /// <param name="owner">The owner of the repository</param> /// <param name="name">The name of the repository</param> /// <param name="number">The Milestone number</param> /// <param name="milestoneUpdate">An <see cref="MilestoneUpdate"/> instance describing the changes to make to the Milestone /// </param> /// <returns></returns> public IObservable <Milestone> Update(string owner, string name, int number, MilestoneUpdate milestoneUpdate) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(milestoneUpdate, "milestoneUpdate"); return(_client.Update(owner, name, number, milestoneUpdate).ToObservable()); }
public async Task CanUpdateOneMilestone() { var newMilestone = new NewMilestone("a milestone") { DueOn = DateTime.Now }; var created = await _milestonesClient.Create(_context.RepositoryOwner, _context.RepositoryName, newMilestone); var result1 = await _milestonesClient.Get(_context.RepositoryOwner, _context.RepositoryName, created.Number); Assert.Equal("a milestone", result1.Title); await _milestonesClient.Update(_context.RepositoryOwner, _context.RepositoryName, created.Number, new MilestoneUpdate { Title = "New title" }); var result2 = await _milestonesClient.Get(_context.RepositoryOwner, _context.RepositoryName, created.Number); Assert.Equal("New title", result2.Title); }