public async Task GetAllTest() { _repoWrapper.Setup(r => r.Degree.GetAllAsync(null, null)).ReturnsAsync(new List <Degree>().AsQueryable()); var service = new DegreeService(_repoWrapper.Object, _mapper.Object); _mapper.Setup(x => x.Map <Degree, DegreeDTO>(It.IsAny <Degree>())).Returns(new DegreeDTO()); // Act var result = await service.GetAllAsync(); // Assert Assert.NotNull(result); Assert.IsAssignableFrom <IEnumerable <DegreeDTO> >(result); }
public DoctorModel() { _doctorService = new DoctorService(); _chamberService = new ChamberService(); _degreeService = new DegreeService(); _specialtyService = new SpecialtyService(); SpecialtyCollection = _specialtyService.GetAll(); DegreeCollection = _degreeService.GetAll(); ChamberCollection = _chamberService.GetAll(); GenderCollection = new List <Gender>() { new Gender() { Id = 1, Name = "Male" }, new Gender() { Id = 2, Name = "Female" }, new Gender() { Id = 3, Name = "Others" } }; BloodGroupCollection = new List <BloodGroup>() { new BloodGroup() { Id = 1, Name = "A+" }, new BloodGroup() { Id = 2, Name = "A-" }, new BloodGroup() { Id = 3, Name = "AB+" } }; }
public DegreeController(DegreeServiceImpl degreeService) { _degreeService = degreeService; }