public void GetAll_Test() { // Arrange TestKolgraphEntities context = new TestKolgraphEntities(); var repository = new PatientPhoneNumberRepository(context); // Act IEnumerable <patientPhoneNumber> result = repository.GetAll(); // Assert Assert.IsNotNull(result); Assert.AreEqual(context.patientPhoneNumber.Count(), result.Count()); }
public void GetAllFilterByPatient_Test() { // Arrange TestKolgraphEntities context = new TestKolgraphEntities(); var repository = new PatientPhoneNumberRepository(context); var service = new PatientPhoneNumberService(repository); // Act IEnumerable <PatientPhoneNumberModel> result = service.GetAllFilterByPatientId(1); // Assert Assert.AreEqual(context.patientPhoneNumber.Where(x => x.patientId == 1).Count(), result.Count()); Assert.AreEqual(result.Where(x => x.PatientId == 1).Count(), result.Count()); }
public void GetAllFilterByPatient_Test() { // Arrange TestKolgraphEntities context = new TestKolgraphEntities(); var repository = new PatientPhoneNumberRepository(context); int patientId = 1; // Act IEnumerable <patientPhoneNumber> result = repository.GetAllFilterByPatient(patientId); // Assert Assert.AreEqual(context.patientPhoneNumber.Where(x => x.patientId == patientId).Count(), result.Count()); Assert.AreEqual(result.Where(x => x.patientId == 1).Count(), result.Count()); }
public void GetById_Test() { // Arrange TestKolgraphEntities context = new TestKolgraphEntities(); var repository = new PatientPhoneNumberRepository(context); int id = 1; // Act patientPhoneNumber result = repository.GetById(id); // Assert Assert.IsNotNull(result); Assert.AreEqual(id, result.id); }