コード例 #1
0
        public void FindByPatientId()
        {
            //Arrange
            var patientId = _dataContext.Monitorings.First().PatientId;

            //Act
            var monitorings = _monitoringService.FindByPatientId(patientId);

            //Assert
            Assert.That(monitorings, Is.Not.Empty);
            Assert.That(monitorings.First().PatientId, Is.EqualTo(patientId));
        }
コード例 #2
0
        public void Delete_WithMonitoring()
        {
            //Arrange
            var patientId = _dataContext.Patients.AsNoTracking().First(p => p.PatientStatus == PatientStatus.Monitoring).Id;

            //Act
            var deleted       = _patientService.Delete(patientId);
            var patient       = _patientService.FindById(patientId);
            var surveillances = _nbrSurveillanceService.FindByPatientId(patientId);
            var monitorings   = _monitoringService.FindByPatientId(patientId);

            //Assert
            Assert.That(deleted, Is.True);
            Assert.That(patient, Is.Null);
            Assert.That(surveillances, Is.Empty);
            Assert.That(monitorings, Is.Empty);
        }
コード例 #3
0
        // GET: Monitoring/List/5
        public ActionResult List(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var monitorings = _monitoringService.FindByPatientId((int)id);

            var viewModel = new ListMonitoringViewModel
            {
                PatientId   = (int)id,
                Monitorings = monitorings
            };

            return(View(viewModel));
        }