public void NonDefaultQueryBuilt()
        {
            var sut = new GroupsQueryBuilder();

            string query = sut.Build(
                "https://gitlab.com/api/v4/groups",
                new GroupsQueryOptions
            {
                SkipGroups   = new[] { 1, 2 },
                AllAvailable = true,
                Search       = "filter",
                Order        = GroupsOrder.Path,
                Sort         = GroupsSort.Descending,
                Statistics   = true,
                Owned        = true
            });

            query.Should().Be("https://gitlab.com/api/v4/groups?" +
                              "skip_groups%5b%5d=1&skip_groups%5b%5d=2&" +
                              "all_available=true&" +
                              "search=filter&" +
                              "order_by=path&" +
                              "sort=desc&" +
                              "statistics=true&" +
                              "owned=true");
        }
예제 #2
0
        /// <summary>
        /// Get a list of visible groups for the authenticated user.
        /// When accessed without authentication, only public groups are returned.
        /// </summary>
        /// <param name="options">Groups retrieval options.</param>
        /// <returns>Groups satisfying options.</returns>
        public async Task <IList <Group> > GetAsync(Action <GroupsQueryOptions> options = null)
        {
            var queryOptions = new GroupsQueryOptions();

            options?.Invoke(queryOptions);

            string url = _queryBuilder.Build("groups", queryOptions);

            return(await _httpFacade.GetPagedList <Group>(url));
        }