Ejemplo n.º 1
0
        public async Task NoQuerySearchOwnerType()
        {
            var query    = new SearchQueryOwnerType();
            var response = await Controller.Search(query);

            CustomAssert.AssertOkResponseCount(response, 3);
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        public async Task SearchByNameNoneExisting()
        {
            var query = new SearchQueryOwnerType {
                Name = "Test"
            };
            var response = await Controller.Search(query);

            CustomAssert.AssertOkResponseCount(response, 0);
        }
Ejemplo n.º 4
0
        public async Task SearchByMinPriority()
        {
            var query = new SearchQueryOwnerType {
                MinPriority = 2
            };
            var response = await Controller.Search(query);

            CustomAssert.AssertOkResponseCount(response, 2);
        }
Ejemplo n.º 5
0
 public async Task <IEnumerable <OwnerType> > Search(SearchQueryOwnerType query)
 {
     return(await _ownerTypeRepository.Search(query));
 }