public async Task GetTherapistByIdTest() { //Arrange var therapistsData = new List <Staff> { new Staff { ID = 1, Name = "Minh", Possition = 3 }, new Staff { ID = 2, Name = "Ly", Possition = 3 } }; TherapistRepoMock.Setup(x => x.GetByIdAsync(It.IsAny <int>())).ReturnsAsync((int i) => therapistsData.Single(t => t.ID == i)); //Action var service = new TherapistService(RepoHelperMock.Object, MapperMock.Object); var result = await service.GetTherapistById(1); //Assert Assert.IsNotNull(result); }
public TherpistRepository GetTherapistRepository() { TherapistService service = TherapistService.GetInstance(); return(TherpistRepository.GetInstance(service)); }