public async Task GetGendersAllTest() { _repoWrapper.Setup(r => r.Gender.GetAllAsync(null, null)).ReturnsAsync(new List <Gender>().AsQueryable()); var service = new UserPersonalDataService(_repoWrapper.Object, _mapper.Object); _mapper.Setup(x => x.Map <Gender, GenderDTO>(It.IsAny <Gender>())).Returns(new GenderDTO()); // Act var result = await service.GetAllGendersAsync(); // Assert Assert.NotNull(result); Assert.IsAssignableFrom <IEnumerable <GenderDTO> >(result); }
public async Task GetAllEducationsGroupBySpecialityTest() { _repoWrapper.Setup(r => r.Education.GetAllAsync(null, null)).ReturnsAsync(new List <Education>().AsQueryable()); var service = new UserPersonalDataService(_repoWrapper.Object, _mapper.Object); _mapper.Setup(x => x.Map <Education, EducationDTO>(It.IsAny <Education>())).Returns(new EducationDTO()); // Act var result = await service.GetAllEducationsGroupBySpecialityAsync(); // Assert Assert.NotNull(result); Assert.IsAssignableFrom <IEnumerable <EducationDTO> >(result); }
public async Task GetEducationsByIdTest() { _repoWrapper.Setup(r => r.Education.GetFirstOrDefaultAsync(It.IsAny <Expression <Func <Education, bool> > >(), null)).ReturnsAsync(new Education()); var service = new UserPersonalDataService(_repoWrapper.Object, _mapper.Object); _mapper.Setup(x => x.Map <Education, EducationDTO>(It.IsAny <Education>())).Returns(new EducationDTO()); // Act var result = await service.GetEducationsByIdAsync(1); // Assert Assert.NotNull(result); Assert.IsType <EducationDTO>(result); }
public async Task GetAllWorkGroupByPositionTest() { _repoWrapper.Setup(r => r.Work.GetAllAsync(null, null)).ReturnsAsync(new List <Work>().AsQueryable()); var service = new UserPersonalDataService(_repoWrapper.Object, _mapper.Object); _mapper.Setup(x => x.Map <Work, WorkDTO>(It.IsAny <Work>())).Returns(new WorkDTO()); // Act var result = await service.GetAllWorkGroupByPositionAsync(); // Assert Assert.NotNull(result); Assert.IsAssignableFrom <IEnumerable <WorkDTO> >(result); }