Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. public class PatientService : IPatientService
  2. {
  3. private readonly IRestClient _restClient;
  4. private readonly IAppSettings _appSettings;
  5.  
  6. public PatientService(IRestClient restClient, IAppSettings appSettings)
  7. {
  8. _restClient = restClient;
  9. _appSettings = appSettings;
  10. }
  11.  
  12. public async Task<IList<PatientViewModel>> GetPatients(int wardId)
  13. {
  14. var url = _appSettings.Server + _appSettings.PatientServiceEndPoint + wardId;
  15. var token = _appSettings.Token;
  16. return GetPatientList(await _restClient.GetAsync<List<PatientInfo>>(url, token));
  17. }
  18.  
  19. public IList<PatientViewModel> GetPatientList(IList<PatientInfo> patientInfoList)
  20. {
  21. return patientInfoList.Select(p => new PatientViewModel(p)).ToList();
  22. }
  23. }
  24.  
  25. private readonly PatientListPageViewModel _patientListPageViewModel;
  26.  
  27. private readonly Mock<IPatientService> _patient;
  28.  
  29. public PatientServiceTests()
  30. {
  31. _patient = new Mock<IPatientService>();
  32. _patientListPageViewModel = new PatientListPageViewModel(_patient.Object);
  33.  
  34. }
  35.  
  36. [Fact]
  37. public void GetListByWard_PassingWardId_GetPatientsCountAccordingToWardId()
  38. {
  39.  
  40.  
  41.  
  42.  
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement