Esempio n. 1
0
        public void Map_PersonsIsNull_ShouldPass()
        {
            // Arrange
            IQueryable <Person> persons = null;

            // Act
            var result = PersonListDtoMapper.Map(persons);

            // Assert
            Assert.IsNull(result);
        }
Esempio n. 2
0
        public async Task <IEnumerable <PersonListDto> > SearchPeople(RequestContext requestContext, string param)
        {
            if (string.IsNullOrEmpty(param))
            {
                return(null);
            }

            var personList = await PersonRepository.Search(requestContext, param);

            return(PersonListDtoMapper.Map(personList));
        }
Esempio n. 3
0
        public void Map_DateOfBirthIsNull_ShouldPass()
        {
            // Arrange
            IQueryable <Person> persons = new List <Person>
            {
                new Person {
                    Id = 1, DateOfBirth = null
                },
            }.AsQueryable();;

            // Act
            var result = PersonListDtoMapper.Map(persons);

            // Assert
            Assert.IsNotNull(result);
        }
Esempio n. 4
0
        public async Task <IEnumerable <PersonListDto> > GetAll(RequestContext requestContext)
        {
            var personList = await PersonRepository.GetAll(requestContext);

            return(PersonListDtoMapper.Map(personList));
        }