public async Task ListAsync_Test()
        {
            /* arrange */

            string testEmail = "*****@*****.**";

            var addWhitelistEntryRequest = DisqusWhitelistAddRequest
                                           .New(TestData.Forum)
                                           .Email(testEmail);

            await Disqus.Whitelists.AddAsync(DisqusAccessToken.Create(TestData.AccessToken), addWhitelistEntryRequest).ConfigureAwait(false);

            var request = DisqusWhitelistListRequest
                          .New(TestData.Forum)
                          .Related(DisqusWhitelistEntryRelated.Forum);

            /* act */

            var response = await Disqus.Whitelists.ListAsync(DisqusAccessToken.Create(TestData.AccessToken), request).ConfigureAwait(false);

            /* assert */

            Assert.That(response, Is.Not.Null);
            Assert.That(response.Code, Is.EqualTo(DisqusApiResponseCode.Success));
            Assert.That(response.Response, Is.Not.Empty);

            /* teardown */

            var removeWhitelistEntryRequest = DisqusWhitelistRemoveRequest
                                              .New(TestData.Forum)
                                              .Email(testEmail);

            await Disqus.Whitelists.RemoveAsync(DisqusAccessToken.Create(TestData.AccessToken), removeWhitelistEntryRequest).ConfigureAwait(false);
        }
Exemple #2
0
        public async Task <CursoredDisqusResponse <IEnumerable <DisqusWhitelistEntry> > > ListAsync(
            DisqusAccessToken accessToken, DisqusWhitelistListRequest request)
        {
            Collection <KeyValuePair <string, string> > parameters = Parameters
                                                                     .WithMultipleParameters(request.Parameters)
                                                                     .WithOptionalParameter("access_token", accessToken);

            return(await RequestProcessor
                   .ExecuteAsync <CursoredDisqusResponse <IEnumerable <DisqusWhitelistEntry> > >(DisqusRequestMethod.Get,
                                                                                                 DisqusEndpoints.Whitelists.List, parameters)
                   .ConfigureAwait(false));
        }