Ejemplo n.º 1
0
        public async Task Should_Return_If_Gets_Wrong_Users_From_Autocomplete()
        {
            var result = (await _bookService.GetUsersForAutoCompleteAsync("Fir", 1)).ToList();

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual("FirstName", result.First().FirstName);
        }
Ejemplo n.º 2
0
        public async Task <IHttpActionResult> GetUsersForAutoComplete(string search, int organizationId)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var mobileUsersDto = await _bookMobileService.GetUsersForAutoCompleteAsync(search, organizationId);

            var mobileUserViewModel = _mapper.Map <IEnumerable <MobileUserDto>, IEnumerable <MobileUserViewModel> >(mobileUsersDto);

            return(Ok(mobileUserViewModel));
        }