Guest User

Untitled

a guest
Jul 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. [Subject(typeof (ListingController))]
  2. public class When_loading_page_n_of_potential_listings : SpecFor<ListingController>
  3. {
  4. static PaginatedQuery<ListingSearchCriteria> query;
  5. static PaginatedQueryResult<ListingSearchModel> queryResult;
  6. static JsonResult result;
  7.  
  8. Establish context = () =>
  9. {
  10. query = new PaginatedQuery<ListingSearchCriteria>();
  11. queryResult= new PaginatedQueryResult<ListingSearchModel>();
  12. the_dependency<IListingRepository>().Stub(repo => repo.GetPotentialListings(query)).Return(queryResult);
  13. };
  14.  
  15. Because of = () =>
  16. {
  17. result = sut.PotentialListings(query);
  18. };
  19.  
  20. It should_return_the_queryResult_as_JSON_response = () =>
  21. {
  22. result.Data.ShouldBeTheSameAs(queryResult);
  23. };
  24.  
  25. }
Add Comment
Please, Sign In to add comment