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); }
public async Task <IEnumerable <AthleteDto> > GetAllAsync() { var athletes = await _athleteRepository.GetAllAsync(); return(_mapper.Map <IEnumerable <AthleteDto> >(athletes)); }