public async Task NoQuerySearchOwnerType() { var query = new SearchQueryOwnerType(); var response = await Controller.Search(query); CustomAssert.AssertOkResponseCount(response, 3); }
public async Task <ActionResult <ICollection <OwnerType> > > Search([FromQuery] SearchQueryOwnerType query) { var mapQuery = _mapper.Map <SearchQueryOwnerType, Domain.Entities.SearchQueryOwnerType>(query); var queryResults = await _ownerTypeService.Search(mapQuery); var queryResultsContract = _mapper.Map <ICollection <OwnerType> >(queryResults); return(Ok(queryResultsContract)); }
public async Task SearchByNameNoneExisting() { var query = new SearchQueryOwnerType { Name = "Test" }; var response = await Controller.Search(query); CustomAssert.AssertOkResponseCount(response, 0); }
public async Task SearchByMinPriority() { var query = new SearchQueryOwnerType { MinPriority = 2 }; var response = await Controller.Search(query); CustomAssert.AssertOkResponseCount(response, 2); }
public async Task <IEnumerable <OwnerType> > Search(SearchQueryOwnerType query) { return(await _ownerTypeRepository.Search(query)); }