예제 #1
0
        public async Task GetAllAsync_ShouldReturnAthletesDto(int count)
        {
            var athletes = _fixture.Build <Athlete>()
                           .Without(a => a.AthleteExercises)
                           .Without(a => a.AthleteProducts)
                           .CreateMany(count: count);

            _athleteRepository.GetAllAsync().Returns(athletes);

            var dto = await _sut.GetAllAsync();

            dto.ShouldNotBeNull();
            dto.ShouldBeOfType(typeof(List <AthleteDto>));
            dto.Count().ShouldBe(count);
        }
예제 #2
0
        public async Task <IEnumerable <AthleteDto> > GetAllAsync()
        {
            var athletes = await _athleteRepository.GetAllAsync();

            return(_mapper.Map <IEnumerable <AthleteDto> >(athletes));
        }