Exemplo n.º 1
0
        public async Task GetContextAsync_Test()
        {
            /* arrange */

            var request = DisqusPostGetContextRequest
                          .New(1)
                          .Depth(4);

            /* act */

            var response = await Disqus.Posts.GetContextAsync(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);
        }
Exemplo n.º 2
0
 public async Task <DisqusResponse <IEnumerable <DisqusPost> > > GetContextAsync(DisqusPostGetContextRequest request)
 {
     return(await GetContextAsync(null, request).ConfigureAwait(false));
 }
Exemplo n.º 3
0
        public async Task <DisqusResponse <IEnumerable <DisqusPost> > > GetContextAsync(DisqusAccessToken accessToken,
                                                                                        DisqusPostGetContextRequest request)
        {
            Collection <KeyValuePair <string, string> > parameters = Parameters
                                                                     .WithMultipleParameters(request.Parameters)
                                                                     .WithOptionalParameter("access_token", accessToken);

            return(await RequestProcessor
                   .ExecuteAsync <DisqusResponse <IEnumerable <DisqusPost> > >(DisqusRequestMethod.Get,
                                                                               DisqusEndpoints.Posts.GetContext, parameters)
                   .ConfigureAwait(false));
        }