Exemple #1
0
        /// <summary>
        /// Get a list of milestones in this group.
        /// </summary>
        /// <param name="groupId">The ID, path or <see cref="Group"/> of the project.</param>
        /// <param name="options">Query options.</param>
        public async Task <IList <Milestone> > GetMilestonesAsync(GroupId groupId, Action <MilestonesQueryOptions> options = null)
        {
            var queryOptions = new MilestonesQueryOptions();

            options?.Invoke(queryOptions);

            string url = _queryMilestonesBuilder.Build($"groups/{groupId}/milestones", queryOptions);

            return(await _httpFacade.GetPagedList <Milestone>(url));
        }
Exemple #2
0
        public void NonDefaultQueryBuilt()
        {
            var sut = new MilestonesQueryBuilder();

            string query = sut.Build(
                "https://gitlab.com/api/v4/projects/projectId/milestones",
                new MilestonesQueryOptions()
            {
                MilestoneIds = { 3, 4 },
                State        = MilestoneState.Active,
                Search       = "filter"
            });

            query.Should().Be("https://gitlab.com/api/v4/projects/projectId/milestones?" +
                              "iids%5b%5d=3&iids%5b%5d=4&" +
                              "state=active&" +
                              "search=filter");
        }