コード例 #1
0
        public async Task GetMembersAsync_ReturnsIEnumerableCityDTO()
        {
            // Arrange
            _repoWrapper.Setup(x => x.City.GetAllAsync(It.IsAny <Expression <Func <DataAccess.Entities.City, bool> > >(),
                                                       It.IsAny <Func <IQueryable <DataAccess.Entities.City>, IIncludableQueryable <DataAccess.Entities.City, object> > >()))
            .ReturnsAsync(new List <DataAccess.Entities.City>());

            _mapper.Setup(x => x.Map <IEnumerable <DataAccess.Entities.City>, IEnumerable <CityDTO> >(It.IsAny <IEnumerable <DataAccess.Entities.City> >()))
            .Returns(cities);

            // Act
            var result = await _regionService.GetMembersAsync(2);

            // Assert
            Assert.IsInstanceOf <IEnumerable <CityDTO> >(result);
            Assert.IsNotNull(result);
        }