public void Setup() { _factory = new Factory(); testIQPatientId = -1; _testPatients = _factory.GenerateTestPatients(); _testEncounters = _factory.GenerateTestEncountersByType(1); _uow = new UnitOfWork(new SyncContext()); _emrRepository = new EmrRepository(); _createEmrPatientHandler = new CreateEmrPatientHandler(); _createEmrEncounterHandler = new CreateEmrEncounterHandler(); _patientService = new PatientService(_uow, _emrRepository, _createEmrPatientHandler, _createEmrEncounterHandler); _encounterService = _patientService.EncounterService; var _visitType = _emrRepository.GetVisitTypeByFeature(_testEncounters.First().EncounterType.IqcareId.Value); var location = _emrRepository.GetLocation(1024); var concepts = _uow.MConceptRepository.GetAllByEncounterType(_testEncounters.First().EncounterTypeId).ToList(); var htslookups = _uow.LookupHtsRepository.GetAll().ToList(); _encounterCreated = new EncounterCreated(_testEncounters.First().Patient, _visitType, _testEncounters.First(), location, concepts, htslookups); }