RetrieveCurrentUsersStream() public method

Retrieves the stream for the current AccessToken. NOTE: Unless changed by the postStreamGeneralParameters, only the latest 20 posts will be returned.
public RetrieveCurrentUsersStream ( PostStreamGeneralParameters postStreamGeneralParameters = null ) : ResponseEnvelope>
postStreamGeneralParameters PostStreamGeneralParameters
return ResponseEnvelope>
Beispiel #1
0
        public void PostsServiceCanRetrieveCurrentUsersStreamFilteredByPostStreamGeneralParameters()
        {
            //Setup
            var postStreamGeneralParameters = new PostStreamGeneralParameters { IncludeUser = 1 };
            var apiCaller = A.Fake<IApiCaller>();
            var postsService = new PostsService(apiCaller);
            A.CallTo(apiCaller).WithReturnType<ResponseEnvelope<List<Post>>>().Returns(new ResponseEnvelope<List<Post>>
                                                                                           {
                                                                                               Data = new List<Post> { new Post { User = new User() } }
                                                                                           });

            //Execute
            var posts = postsService.RetrieveCurrentUsersStream(postStreamGeneralParameters);

            //Verify
            posts.Data.ShouldNotBeNull();
            posts.Data.ShouldHaveCount(1);
            posts.Data[0].User.ShouldNotBeNull();

            //Teardown
        }
Beispiel #2
0
        public void PostsServiceCanRetrieveCurrentUsersStream()
        {
            //Setup
            var apiCaller = A.Fake<IApiCaller>();
            var postsService = new PostsService(apiCaller);
            A.CallTo(() => apiCaller.ApiGet<List<Post>>(PostsService.POSTS_ENDPOINT + PostsService.STREAM_ENDPOINT, null)).Returns(new ResponseEnvelope<List<Post>>
                                                                                                                                       {
                                                                                                                                           Data = new List<Post> { new Post() }
                                                                                                                                       });

            //Execute
            var posts = postsService.RetrieveCurrentUsersStream();

            //Verify
            posts.Data.ShouldNotBeNull();
            posts.Data.ShouldHaveCount(1);

            //Teardown
        }