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); }
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)); }
public static void GetSubmissionsAndComments(Session session, out PostListing posts, out CommentListing comments) { posts = null; comments = null; }