/// <summary>
        /// Creates a milestone for the specified repository. Any user with pull access to a repository can create an
        /// 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 Task <Milestone> Update(string owner, string name, int number, MilestoneUpdate milestoneUpdate)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");
            Ensure.ArgumentNotNull(milestoneUpdate, "milestoneUpdate");

            return(ApiConnection.Patch <Milestone>(ApiUrls.Milestone(owner, name, number), milestoneUpdate));
        }
            public void UpdatesClientIssueMilestone()
            {
                var milestoneUpdate = new MilestoneUpdate();
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableMilestonesClient(gitHubClient);

                client.Update("fake", "repo", 42, milestoneUpdate);

                gitHubClient.Issue.Milestone.Received().Update("fake", "repo", 42, milestoneUpdate);
            }
Beispiel #3
0
        public Task <Milestone> Update(long repositoryId, int number, MilestoneUpdate milestoneUpdate)
        {
            Ensure.ArgumentNotNull(milestoneUpdate, nameof(milestoneUpdate));

            return(ApiConnection.Patch <Milestone>(ApiUrls.Milestone(repositoryId, number), milestoneUpdate));
        }
        /// <summary>
        /// Creates an Milestone for the specified repository. Any user with pull access to a repository can create an
        /// 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 Task<Milestone> Update(string owner, string name, int number, MilestoneUpdate milestoneUpdate)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");
            Ensure.ArgumentNotNull(milestoneUpdate, "milestoneUpdate");

            return ApiConnection.Patch<Milestone>(ApiUrls.Milestone(owner, name, number), milestoneUpdate);
        }
        /// <summary>
        /// Creates a milestone for the specified repository. Any user with pull access to a repository can create an
        /// Milestone.
        /// </summary>
        /// <remarks>http://developer.github.com/v3/issues/milestones/#update-a-milestone</remarks>
        /// <param name="repositoryId">The Id 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 Task<Milestone> Update(long repositoryId, int number, MilestoneUpdate milestoneUpdate)
        {
            Ensure.ArgumentNotNull(milestoneUpdate, "milestoneUpdate");

            return ApiConnection.Patch<Milestone>(ApiUrls.Milestone(repositoryId, number), milestoneUpdate);
        }
        public void PostsToCorrectUrl()
        {
            var milestoneUpdate = new MilestoneUpdate();
            var connection = Substitute.For<IApiConnection>();
            var client = new MilestonesClient(connection);

            client.Update("fake", "repo", 42, milestoneUpdate);

            connection.Received().Patch<Milestone>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/milestones/42"),
                milestoneUpdate);
        }