示例#1
0
        public void GetSubPosts_Paging_Loop()
        {
            var         session = User.Login(Configuration.GetKey("username"), Configuration.GetKey("password"));
            var         list    = new PostListing();
            PostListing page    = null;

            do
            {
                page = Sub.GetListing(session,
                                      SubRedditToTestWith,
                                      page == null ? string.Empty : page.After);

                list.AddRange(page);
            } while (!string.IsNullOrEmpty(page.After));

            Assert.IsNotNull(list);
            Assert.IsTrue(list.Count > 0);
        }
示例#2
0
        public HttpResponseMessage PostListing([FromBody] RealtorListing realtorListing)
        {
            var listingId   = Guid.NewGuid();
            var postListing = new PostListing(
                listingId,
                realtorListing.NumberOfBathrooms,
                realtorListing.NumberOfBedrooms,
                realtorListing.YearBuilt,
                realtorListing.Street,
                realtorListing.City,
                realtorListing.State,
                realtorListing.Zip,
                realtorListing.Price);

            try
            {
                _commandBus.Dispatch(postListing);
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex));
            }
            return(Request.CreateResponse(HttpStatusCode.Created, postListing));
        }
示例#3
0
文件: Sub.cs 项目: openemma/reddit
        public void GetSubPosts_Paging_Loop()
        {
            var session = User.Login(Configuration.GetKey("username"), Configuration.GetKey("password"));
            var list = new PostListing();
            PostListing page = null;

            do
            {
                page = Sub.GetListing(session,
                                      SubRedditToTestWith,
                                      page == null ? string.Empty : page.After);

                list.AddRange(page);

            } while (!string.IsNullOrEmpty(page.After));

            Assert.IsNotNull(list);
            Assert.IsTrue(list.Count > 0);
        }
示例#4
0
 public static void GetSubmissionsAndComments(Session session, out PostListing posts, out CommentListing comments)
 {
     posts = null;
     comments = null;
 }