public void Can_Get_Patients_By_Last_Name()
        {
            var list = new List <Patient>()
            {
                new Patient()
                {
                    NameLast = "Archer", NameFirst = "Mallory"
                },
                new Patient()
                {
                    NameLast = "Archer", NameFirst = "Sterling"
                },
                new Patient()
                {
                    NameLast = "Krieger", NameFirst = "Victor"
                },
                new Patient()
                {
                    NameLast = "Boones", NameFirst = "Samuel"
                }
            };

            _mockDataContext
            .Setup(context => context.AsQueryable <Patient>())
            .Returns(list.AsQueryable());

            var response = _service.Find(new PatientSearchCriteria()
            {
                LastName = "Archer"
            });

            Assert.IsFalse(response.HasError);
            Assert.AreEqual(2, response.Result.Count);
        }
示例#2
0
        public ActionResult Find(FormCollection Collection)
        {
            string         Keyword = Collection["Keyword"];
            List <Patient> Result;

            try
            {
                Result = Service.Find(Keyword);
                if (Result.Count > 0)
                {
                    return(View("FindResult", Result));
                }
                else
                {
                    return(View("NotFound"));
                }
            }
            catch
            {
                return(RedirectToAction("Index"));
            }
        }
 public IActionResult FindPatients(IEnumerable <int> patientIds)
 {
     return(Ok(_patientService.Find(patientIds)));
 }
示例#4
0
        public Domain.Entities.Patient.Patient FindById(Guid id)
        {
            HasToBeAuthenticated();

            return(_patientService.Find(id));
        }