public void CreateVisit_NullClinicalCase_ThrowsArgumentException() { var visitRepository = new Mock <IVisitRepository> (); var visitStatus = new Mock <VisitStatus> (); visitStatus.SetupProperty(v => v.WellKnownName, WellKnownNames.VisitModule.VisitStatus.Scheduled); var visitStatusRepository = new Mock <IVisitStatusRepository> (); visitStatusRepository .Setup(v => v.GetByWellKnownName(WellKnownNames.VisitModule.VisitStatus.Scheduled)) .Returns(visitStatus.Object); var visitFactory = new VisitFactory( visitRepository.Object, visitStatusRepository.Object); var patient = new Mock <Patient> (); var visitTemplate = new Mock <VisitTemplate> (); var initialLocation = new Mock <Location> (); var staff = new Mock <Staff> (); var appointmentDateTimeRange = new DateTimeRange(new DateTime(), new DateTime()); visitFactory.CreateVisit( staff.Object, appointmentDateTimeRange, null, visitTemplate.Object, initialLocation.Object); }
public void CreateVisit_GivenValidArguments_VisitIsEditable() { using (var serviceLocatorFixture = new ServiceLocatorFixture()) { // Setup var visitRepository = new Mock <IVisitRepository> (); var visitStatus = new Mock <VisitStatus> (); visitStatus.SetupProperty(v => v.WellKnownName, WellKnownNames.VisitModule.VisitStatus.Scheduled); var visitStatusRepository = new Mock <IVisitStatusRepository> (); visitStatusRepository .Setup(v => v.GetByWellKnownName(WellKnownNames.VisitModule.VisitStatus.Scheduled)) .Returns(visitStatus.Object); var visitFactory = new VisitFactory( visitRepository.Object, visitStatusRepository.Object); var patient = new Mock <Patient> (); var clinicalCase = new Mock <ClinicalCase> (); clinicalCase.Setup(c => c.Patient).Returns(patient.Object); var agency = new Mock <Agency>(); var visitTemplate = new VisitTemplate(agency.Object, "Initial Behavioral Health - Adult", "99204"); var initialLocation = new Mock <Location> (); var staff = new Mock <Staff> (); var appointmentDateTimeRange = new DateTimeRange(new DateTime(), new DateTime()); var visit = visitFactory.CreateVisit( staff.Object, appointmentDateTimeRange, clinicalCase.Object, visitTemplate, initialLocation.Object); visit.ReviseNote("note"); } }