public async Task GetRegionProfileByIdAsync_ReturnsCorrectAsync() { // Arrange _repoWrapper .Setup(x => x.Region.GetFirstOrDefaultAsync(It.IsAny <Expression <Func <Region, bool> > >(), It.IsAny <Func <IQueryable <Region>, IIncludableQueryable <Region, object> > >())) .ReturnsAsync(new Region()); _cityService .Setup(x => x.GetCitiesByRegionAsync(It.IsAny <int>())) .ReturnsAsync(cities); _mapper .Setup(x => x.Map <RegionDTO, RegionProfileDTO>(It.IsAny <RegionDTO>())) .Returns(regionProfileDTO); _mapper .Setup(x => x.Map <Region, RegionDTO>(It.IsAny <Region>())) .Returns(regionDTO); _userManager .Setup(x => x.GetRolesAsync(It.IsAny <User>())) .ReturnsAsync(new List <string>() { Roles.Admin, Roles.OkrugaHead, Roles.OkrugaHeadDeputy }); _repoWrapper .Setup(x => x.RegionDocument.GetAllAsync(It.IsAny <Expression <Func <RegionDocuments, bool> > >(), It.IsAny <Func <IQueryable <RegionDocuments>, IIncludableQueryable <RegionDocuments, object> > >())) .ReturnsAsync(new List <RegionDocuments>()); // Act var result = await _regionService.GetRegionProfileByIdAsync(fakeId, user); // Assert Assert.IsNotNull(result); Assert.IsInstanceOf <RegionProfileDTO>(result); }