private void SetUpArrestSummary() { var arrestSummaryList = new List <ArrestSummary>(); var arrestSummary = new ArrestSummary(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid(), Number, null); arrestSummaryList.Add(arrestSummary); _summariesUnitOfWork.Setup(mock => mock.GetEntityQuery <ArrestSummary>(It.IsAny <TrackingMode>())).Returns(arrestSummaryList.AsQueryable); }
public void ArrestSummaryQueryService_FindArrestSummaryFromAgencyId() { arrestSummary = FindArrestSummary(); Assert.IsNotNull(arrestSummary); using (var arrestSummaryQueryService = DependencyContainer.Resolve <IArrestSummaryQueryService>()) { Assert.IsInstanceOfType(arrestSummaryQueryService.Instance, typeof(IArrestSummaryQueryService)); arrestSummary = arrestSummaryQueryService.Instance.FindArrestSummary(agencyId, number); Assert.IsNotNull(arrestSummary); } }
public void ArrestSummaryQueryService_FindArrestSynopsis() { arrestSummary = FindArrestSummary(); Assert.IsNotNull(arrestSummary); CreateArrestEvent(); using (var arrestSummaryQueryService = DependencyContainer.Resolve <IArrestSummaryQueryService>()) { Assert.IsInstanceOfType(arrestSummaryQueryService.Instance, typeof(IArrestSummaryQueryService)); ArrestSynopsis arrestSynopsis = arrestSummaryQueryService.Instance.FindArrestSynopsis(arrestSummaryGui); Assert.IsNotNull(arrestSynopsis); } }
public void GetArrestSummaries() { SetUpIdentitityContext(ModuleType.Arrest); var arrestSummaryList = new List <ArrestSummary>(); var arrestSummary = new ArrestSummary(QueueUnitTestFixture.IdentityId, QueueUnitTestFixture.AgencyDetails.Id, It.IsAny <Guid>(), "123", null); arrestSummaryList.Add(arrestSummary); _summariesUnitOfWork.Setup(mock => mock.GetEntityQuery <ArrestSummary>(TrackingMode.Automatic)) .Returns(arrestSummaryList.AsQueryable()); var arrestSummaryQueue = _summaryQueueService.GetArrestSummaries(It.IsAny <SummaryQueueFilter>()); arrestSummaryQueue.Should().NotBeEmpty(); arrestSummaryQueue.Should().BeOfType(typeof(List <ArrestSummaryQueueItem>)); _summariesUnitOfWork.Verify(mock => mock.GetEntityQuery <ArrestSummary>(TrackingMode.Automatic)); }
public void ArrestSummaryQueryService_FindArrestDrugSummaryId() { arrestSummary = FindArrestSummary(); Assert.IsNotNull(arrestSummary); CreateArrestDrug(); // Find using (var ioc = DependencyContainer.Resolve <IArrestSummaryQueryService>()) { var svc = ioc.Instance; Assert.IsInstanceOfType(svc, typeof(IArrestSummaryQueryService)); Guid?arrestDrugGuid = svc.FindArrestDrugSummaryId(drugId); Assert.IsNotNull(arrestDrugGuid); } }
public void ArrestSummaryQueryService_FindArrestGun() { arrestSummary = FindArrestSummary(); Assert.IsNotNull(arrestSummary); CreateArrestGun(); // Find using (var ioc = DependencyContainer.Resolve <IArrestSummaryQueryService>()) { ArrestGun arrestGun; var svc = ioc.Instance; Assert.IsInstanceOfType(svc, typeof(IArrestSummaryQueryService)); arrestGun = svc.FindArrestGun(gunId); Assert.IsNotNull(arrestGun); } }
public void ArrestSummaryQueryService_FindArrestNarrative() { arrestSummary = FindArrestSummary(); Assert.IsNotNull(arrestSummary); CreateArrestNarrative(); // Find ArrestNarrative arrestNarrative; using (var ioc = DependencyContainer.Resolve <IArrestSummaryQueryService>()) { var svc = ioc.Instance; Assert.IsInstanceOfType(svc, typeof(IArrestSummaryQueryService)); arrestNarrative = svc.FindArrestNarrative(arrestNarrativeId); Assert.IsNotNull(arrestNarrative); } }
public void ArrestSummaryQueryService_FindArrestAlcoholDrugTestSummaryId() { arrestSummary = FindArrestSummary(); Assert.IsNotNull(arrestSummary); CreateArrestAlcoholDrugTest(); // Find ArrestAlcoholDrugTest alcoholDrugTest; using (var ioc = DependencyContainer.Resolve <IArrestSummaryQueryService>()) { var svc = ioc.Instance; Assert.IsInstanceOfType(svc, typeof(IArrestSummaryQueryService)); alcoholDrugTest = svc.FindArrestAlcoholDrugTest(alcoholDrugTestId); Assert.IsNotNull(alcoholDrugTest); } }
public void ArrestSummaryQueryService_FindArrestEvent() { arrestSummary = FindArrestSummary(); Assert.IsNotNull(arrestSummary); CreateArrestEvent(); // Find ArrestEvent eventDetails; using (var ioc = DependencyContainer.Resolve <IArrestSummaryQueryService>()) { var svc = ioc.Instance; Assert.IsInstanceOfType(svc, typeof(IArrestSummaryQueryService)); eventDetails = svc.FindArrestEvent(eventId); Assert.IsNotNull(eventDetails); Assert.AreEqual(eventId, eventDetails.Id); } }
private void PrepareArrestSummarySectionsForReport(Section templateSection, string sectionHeader, ArrestSummary arrestSummary, IReportsData reportDetails) { //All Public Safety type items var itemList = new List <IPublicSafetyEntityDetails>(); switch (templateSection.SectionType) { case SectionType.Event: itemList.Add(arrestSummary.Event); sectionHeader = GenericSectionName.EVENT; PreparePublicSafetyEntityForReport(templateSection, itemList, sectionHeader, string.Empty, reportDetails); break; case SectionType.Person: if (templateSection.Name == GenericSectionName.ARRESTEE) { itemList.Add(arrestSummary.Arrestee); } PreparePublicSafetyEntityForReport(templateSection, itemList, sectionHeader, string.Empty, reportDetails); break; case SectionType.Generic: if (templateSection.Name == GenericSectionName.ALCOHOL_DRUG_TESTS) { PreparePublicSafetyEntityForReport(templateSection, arrestSummary.AlcoholDrugTests.Cast <IPublicSafetyEntityDetails>().ToList(), sectionHeader, string.Empty, reportDetails); } break; case SectionType.Offense: if (templateSection.Name == GenericSectionName.ARREST_CHARGES) { sectionHeader = GenericSectionName.OFFENSES; PreparePublicSafetyEntityForReport(templateSection, arrestSummary.ArrestCharges.Cast <IPublicSafetyEntityDetails>().ToList(), sectionHeader, string.Empty, reportDetails); } break; case SectionType.Drug: PreparePublicSafetyEntityForReport(templateSection, arrestSummary.Drugs.Cast <IPublicSafetyEntityDetails>().ToList(), sectionHeader, string.Empty, reportDetails); break; case SectionType.Gun: PreparePublicSafetyEntityForReport(templateSection, arrestSummary.Guns.Cast <IPublicSafetyEntityDetails>().ToList(), sectionHeader, string.Empty, reportDetails); break; case SectionType.Narrative: PreparePublicSafetyEntityForReport(templateSection, arrestSummary.Narratives.Cast <IPublicSafetyEntityDetails>().ToList(), sectionHeader, string.Empty, reportDetails); break; case SectionType.Officer: PreparePublicSafetyEntityForReport(templateSection, arrestSummary.Officers.Cast <IPublicSafetyEntityDetails>().ToList(), sectionHeader, string.Empty, reportDetails); break; case SectionType.Property: PreparePublicSafetyEntityForReport(templateSection, arrestSummary.Property.Cast <IPublicSafetyEntityDetails>().ToList(), sectionHeader, string.Empty, reportDetails); break; case SectionType.Vehicle: PreparePublicSafetyEntityForReport(templateSection, arrestSummary.Vehicles.Cast <IPublicSafetyEntityDetails>().ToList(), sectionHeader, string.Empty, reportDetails); break; } }
public ArrestSummary Create(Guid agencyId, string number, ArrestSummary summary) { summary.Id = _arrestSummaryCommandService.CreateArrestSummary(agencyId, number, summary); return(summary); }
public void ArrestSummaryQueryService_FindArrestSummaryFromId() { arrestSummary = FindArrestSummary(); Assert.IsNotNull(arrestSummary); }
public ArrestSynopsis FindArrestSynopsis(Guid id) { ArrestSummary summary = FindArrestSummary(id); return(summary.As <ArrestSynopsis>()); }