public async Task GetAllGroupBySpecialityTest() { _repoWrapper.Setup(r => r.Education.GetAllAsync(null, null)).ReturnsAsync(new List <Education>().AsQueryable()); var service = new EducationService(_repoWrapper.Object, _mapper.Object); _mapper.Setup(x => x.Map <Education, EducationDTO>(It.IsAny <Education>())).Returns(new EducationDTO()); // Act var result = await service.GetAllGroupBySpecialityAsync(); // Assert Assert.NotNull(result); Assert.IsAssignableFrom <IEnumerable <EducationDTO> >(result); }