Beispiel #1
0
        public async Task GetTagsAsync()
        {
            var apiConnection = Substitute.For <IApiConnection>();
            var client        = new FollowClient(apiConnection);

            await client.GetTagsAsync();

            await apiConnection.Received().ExecuteGetCollectionAsync <FollowedTag>("follows/tags");
        }
Beispiel #2
0
 /// <inheritdoc />
 internal UserClient(PixivClient pixivClient) : base(pixivClient)
 {
     Bookmarks       = new BookmarksClient(pixivClient);
     BookmarkTags    = new BookmarkTagsClient(pixivClient);
     BrowsingHistory = new BrowsingHistoryClient(pixivClient);
     Me        = new MeClient(pixivClient);
     Profile   = new ProfileClient(pixivClient);
     Workspace = new WorkspaceClient(pixivClient);
     Follow    = new FollowClient(pixivClient);
 }
        public async Task OfCurrentUser_PassesQueryParams()
        {
            var api    = new Mock <IAPIConnector>();
            var client = new FollowClient(api.Object);

            var request = new FollowOfCurrentUserRequest(FollowOfCurrentUserRequest.Type.Artist);
            await client.OfCurrentUser(request);

            api.Verify(a => a.Get <FollowedArtistsResponse>(
                           SpotifyUrls.CurrentUserFollower(),
                           It.Is <Dictionary <string, string> >(val => val.ContainsKey("type"))
                           ));
        }
Beispiel #4
0
        /// <summary>
        /// API client
        /// </summary>
        /// <remarks>
        /// See the <a href="https://docs.dev.to/api/#section/Authentication/api_key">Authentication</a> for more information
        /// </remarks>
        /// <param name="apiUrl">API connection url</param>
        /// <param name="token">API key</param>
        public DevToClient(string apiUrl, string token)
        {
            var restClient = new RestClient(apiUrl);

            restClient.AddDefaultHeader("api-key", token);
            restClient.AddDefaultHeader("User-Agent", "DevToAPI-client-dotnet");
            var apiConnection = new ApiConnection(restClient);

            AdminConfigurations = new AdminConfigurationClient(apiConnection);
            Articles            = new ArticleClient(apiConnection);
            Comments            = new CommentClient(apiConnection);
            Followers           = new FollowerClient(apiConnection);
            Follows             = new FollowClient(apiConnection);
            Listings            = new ListingClient(apiConnection);
            Organizations       = new OrganizationClient(apiConnection);
            PodcastEpisodes     = new PodcastEpisodeClient(apiConnection);
            ReadingLists        = new ReadingListClient(apiConnection);
            Tags          = new TagClient(apiConnection);
            Users         = new UserClient(apiConnection);
            Videos        = new VideoClient(apiConnection);
            Webhooks      = new WebhookClient(apiConnection);
            ProfileImages = new ProfileImageClient(apiConnection);
        }
Beispiel #5
0
 public Task <FollowChannelResponse> GetFollowChannelAsync(uint limit = 25, uint page = 0)
 {
     return(FollowClient.GetFollowChannelAsync(_context, limit, page));
 }
Beispiel #6
0
 public Task <ChannelAuthorityResponse> GetChannelAuthorityAsync(uint channelNumberId)
 {
     return(FollowClient.GetChannelAuthorityAsync(_context, channelNumberId));
 }
Beispiel #7
0
 public Task <ContentManageResult> RemoveFollowCommunityAsync(string communityId)
 {
     return(FollowClient.RemoveFollowCommunityAsync(_context, communityId));
 }
Beispiel #8
0
 public Task <CommunityAuthorityResponse> GetCommunityAuthorityAsync(string communityId)
 {
     return(FollowClient.GetCommunityAuthorityAsync(_context, communityId));
 }
Beispiel #9
0
 public Task <UserOwnedCommunityResponse> GetUserOwnedCommunitiesAsync(uint userId)
 {
     return(FollowClient.GetUserOwnedCommunitiesAsync(_context, userId));
 }