public void IncidentSummaryQueryService_FindIncidentNarrative() { // Create ReportId var systemQuery = GetDependency <ISystemQueryService>(); Assert.IsInstanceOfType(systemQuery, typeof(ISystemQueryService)); var fICommandService = GetDependency <IIncidentSummaryCommandService>(); Assert.IsInstanceOfType(fICommandService, typeof(IIncidentSummaryCommandService)); var incidentDetails = MockObjects.NewIncidentSummary; Guid summaryId = fICommandService.CreateIncidentSummary(systemQuery.GetAgencies()[0].AgencyId, "Random Case #" + new Random().Next(int.MaxValue), incidentDetails); Assert.IsInstanceOfType(summaryId, typeof(Guid)); Assert.AreNotEqual(summaryId, Guid.Empty); // Create Narrative Guid narrativeId = fICommandService.CreateIncidentNarrative(summaryId, MockObjects.NewIncidentNarrative); Assert.IsInstanceOfType(narrativeId, typeof(Guid)); Assert.AreNotEqual(narrativeId, Guid.Empty); // Find var iSummaryQueryService = GetDependency <IIncidentSummaryQueryService>(); Assert.IsInstanceOfType(iSummaryQueryService, typeof(IIncidentSummaryQueryService)); IncidentNarrative incidentNarrative = iSummaryQueryService.FindIncidentNarrative(narrativeId); Assert.IsNotNull(incidentNarrative); }
public void IncidentReportQueryService_FindIncidentNarrative() { // Create ReportId var iCommandService = GetDependency <IIncidentReportCommandService>(); Assert.IsInstanceOfType(iCommandService, typeof(IIncidentReportCommandService)); Guid reportId = GetReportId(); Assert.IsInstanceOfType(reportId, typeof(Guid)); Assert.AreNotEqual(reportId, Guid.Empty); // Create incident Narrative section var narrativeDetails = MockObjects.NewIncidentNarrative; Guid incidentNarrativeId = iCommandService.CreateIncidentNarrative(reportId, narrativeDetails); Assert.IsInstanceOfType(incidentNarrativeId, typeof(Guid)); Assert.AreNotEqual(incidentNarrativeId, Guid.Empty); //Find incident Narrative section var incidentReportQueryService = GetDependency <IIncidentReportQueryService>(); Assert.IsInstanceOfType(incidentReportQueryService, typeof(IIncidentReportQueryService)); IncidentNarrative reportDetails = incidentReportQueryService.FindIncidentNarrative(incidentNarrativeId); Assert.IsNotNull(reportDetails); Assert.AreEqual(incidentNarrativeId, reportDetails.Id); Assert.AreEqual(narrativeDetails.AuthorName, reportDetails.AuthorName); }