public async void GetAll_NotNull_OkAndPagedList() { var service = new MockPatientService().GetAll(new List <GetPatientDto>()); var controller = new PatientsController(service.Object, null); var result = await controller.GetAll(); Assert.IsType <OkObjectResult>(result); }
public void GetAllPatients_Count_PatientsResponse_Test() { //Arrage IDbContext dbContext = new MedicalAppointmentContext(); IRepository repository = new PatientRepository(dbContext); var sut = new PatientsController(repository); var expectedResult = 5; //Act var result = sut.GetAll() as OkNegotiatedContentResult <IEnumerable <IPatient> >; var patientListResult = result.Content as List <Patient>; //Assert Assert.AreEqual(expectedResult, patientListResult.Count); }
public void GetAllPatients_NotNullResponse_Test() { //Arrage IDbContext dbContext = new MedicalAppointmentContext(); IRepository repository = new PatientRepository(dbContext); var sut = new PatientsController(repository); //Act var result = sut.GetAll() as OkNegotiatedContentResult <IEnumerable <IPatient> >; var patientListResult = result.Content as IEnumerable <IPatient>; //Assert Assert.IsNotNull(result); Assert.IsNotNull(patientListResult); }