private void SetUpCallForServiceReport() { var callForServiceReport = new CallForServiceReport(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid(), Guid.NewGuid(), false); callForServiceReport.Number = Number; _reportsUnitOfWork.Setup(mock => mock.Find <Report>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>())).Returns(callForServiceReport); }
private CallForServiceReport SetUpCallForService() { var callForServiceReport = new CallForServiceReport(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid(), Guid.NewGuid(), false); callForServiceReport.Number = Number; callForServiceReport.CaseNumber = "999"; return(callForServiceReport); }
public void ClassSetUp() { _factory = new MockRepository(MockBehavior.Loose); _authorizationPolicy = new Mock <IServiceAuthorizationPolicy>(); _identityProvider = new Mock <IServiceIdentityProvider>(); _callForServiceReport = new CallForServiceReport(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid(), Guid.NewGuid(), false); _messageBusClient = _factory.Create <IMessageBusPublishClient>(); _authorizationPolicy.Setup(mock => mock.RequireCreatePermissions(It.IsAny <IdentityContext>(), It.IsAny <Guid>(), It.IsAny <ModuleType>())); _reportsUnitOfWork = _factory.Create <IReportsUnitOfWork>(); _reportsUnitOfWork.Setup(mock => mock.Find <CallForServiceReport>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>())) .Returns(_callForServiceReport); _reportsUnitOfWork.Setup(x => x.PendingMessages).Returns(new System.Collections.Generic.List <TriTech.InformRMS.Infrastructure.Messaging.Contracts.Messages.Message>()); _callForServiceReportCommandService = new CallForServiceReportCommandService(_reportsUnitOfWork.Object, Mock.Of <IWorkflowInstanceService>(), Mock.Of <ITemplateProvider>(), Mock.Of <ILog>(), _authorizationPolicy.Object, _identityProvider.Object); }
public CallForServiceSynopsis FindCallForServiceSynopsis(Guid id) { CallForServiceReport summary = FindCallForServiceReport(id); return(summary.As <CallForServiceSynopsis>()); }
private void PrepareCallForServiceReportSectionsForReport(Section templateSection, string sectionHeader, CallForServiceReport callForServiceReport, IReportsData reportDetails) { var itemList = new List <IPublicSafetyEntityDetails>(); switch (templateSection.SectionType) { case SectionType.Event: itemList.Add(callForServiceReport.CallForServiceEvent); sectionHeader = GenericSectionName.EVENT; PreparePublicSafetyEntityForReport( templateSection, itemList, sectionHeader, string.Empty, reportDetails); break; case SectionType.Person: PrepareCallForServicePersonEntityForReport( templateSection, callForServiceReport.CallForServicePersons.ToList(), sectionHeader, reportDetails); break; case SectionType.Property: sectionHeader = GenericSectionName.PROPERTY; PreparePublicSafetyEntityForReport(templateSection, callForServiceReport.CallForServiceProperty.Cast <IPublicSafetyEntityDetails>().ToList(), sectionHeader, string.Empty, reportDetails); break; case SectionType.Organization: PrepareCallForServiceOrganizationEntityForReport( templateSection, callForServiceReport.CallForServiceOrganizations.ToList(), sectionHeader, reportDetails); break; case SectionType.Vehicle: PreparePublicSafetyEntityForReport( templateSection, callForServiceReport.CallForServiceVehicles.Cast <IPublicSafetyEntityDetails>().ToList(), sectionHeader, string.Empty, reportDetails); break; case SectionType.CFSResponse: PreparePublicSafetyEntityForReport( templateSection, callForServiceReport.CallForServiceResponses.Cast <IPublicSafetyEntityDetails>().ToList(), sectionHeader, string.Empty, reportDetails); break; case SectionType.Narrative: PreparePublicSafetyEntityForReport( templateSection, callForServiceReport.CallForServiceNarratives.Cast <IPublicSafetyEntityDetails>().ToList(), sectionHeader, string.Empty, reportDetails); break; case SectionType.CFS911: PreparePublicSafetyEntityForReport( templateSection, callForServiceReport.CallForServiceE911s.Cast <IPublicSafetyEntityDetails>().ToList(), sectionHeader, string.Empty, reportDetails); break; //Not implemented in 4.8 //case SectionType.CFSCaseReceived: // PreparePublicSafetyEntityForReport( // templateSection, // callForServiceReport.CallForServiceCasesReceived.Cast<IPublicSafetyEntityDetails>().ToList(), // sectionHeader, // string.Empty, // reportDetails); // break; } }
public CallForServiceReport Create(CallForServiceReport report) { report.Id = _reportCommandService.CreateReportWithTemplate(report.TemplateId, report.IsSupplement, report); return(report); }