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

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

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

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