Пример #1
0
        public async Task GetAllDtoTest()
        {
            ClubService ClubService = CreateClubService();

            var result = await ClubService.GetAllDtoAsync(null);

            Assert.NotNull(result);
        }
        public async Task GetAllDTOAsync_ReturnsAllDTO()
        {
            // Arrange
            _mapper
            .Setup(m => m.Map <IEnumerable <DataAccessClub.Club>, IEnumerable <ClubDTO> >(It.IsAny <IEnumerable <DataAccessClub.Club> >()))
            .Returns(GetTestClubDTO());
            _repoWrapper
            .Setup(r => r.Club.GetAllAsync(It.IsAny <Expression <Func <DataAccessClub.Club, bool> > >(),
                                           It.IsAny <Func <IQueryable <DataAccessClub.Club>, IIncludableQueryable <DataAccessClub.Club, object> > >()))
            .ReturnsAsync(GetTestClub());

            // Act
            var result = await _clubService.GetAllDtoAsync();

            // Assert
            Assert.NotNull(result);
            Assert.IsInstanceOf <IEnumerable <ClubDTO> >(result);
        }