public async Task GetAllGroupByPositionTest() { _repoWrapper.Setup(r => r.Work.GetAllAsync(null, null)).ReturnsAsync(new List <Work>().AsQueryable()); var service = new WorkService(_repoWrapper.Object, _mapper.Object); _mapper.Setup(x => x.Map <Work, WorkDTO>(It.IsAny <Work>())).Returns(new WorkDTO()); // Act var result = await service.GetAllGroupByPositionAsync(); // Assert Assert.NotNull(result); Assert.IsAssignableFrom <IEnumerable <WorkDTO> >(result); }