public async Task GivenAListOfUsers_WhenGetAllUsers_ThenReturnListOfUsersEntity() { var consultant = ConsultantFactory.Added2Consultants(_database.DbContext); var result = await _repository.GetAllAsync(); result.Should().BeOfType <List <Consultant> >(); var addedConsultant = result.FirstOrDefault(u => u.Id == consultant.Id); addedConsultant.Should().NotBeNull(); }
public async Task <IEnumerable <Consultant> > Handle(GetAllConsultantsQuery request, CancellationToken cancellationToken) { var entities = await _repository.GetAllAsync(); return(entities.Select(entity => entity.HidePassword())); }