public void IncidentSummaryQueryService_FindIncidentOfficer() { // 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 Officer Guid officerId = fICommandService.CreateIncidentOfficer(summaryId, MockObjects.NewIncidentOfficer); Assert.IsInstanceOfType(officerId, typeof(Guid)); Assert.AreNotEqual(officerId, Guid.Empty); // Find var iSummaryQueryService = GetDependency <IIncidentSummaryQueryService>(); Assert.IsInstanceOfType(iSummaryQueryService, typeof(IIncidentSummaryQueryService)); IncidentOfficer incidentOfficer = iSummaryQueryService.FindIncidentOfficer(officerId); Assert.IsNotNull(incidentOfficer); }
public void IncidentReportQueryService_FindIncidentOfficer() { var iCommandService = GetDependency <IIncidentReportCommandService>(); Assert.IsInstanceOfType(iCommandService, typeof(IIncidentReportCommandService)); Guid reportId = GetReportId(); Assert.IsInstanceOfType(reportId, typeof(Guid)); Assert.AreNotEqual(reportId, Guid.Empty); // Create incident Gun section var officerDetails = MockObjects.NewIncidentOfficer; Guid incidentOfficerId = iCommandService.CreateIncidentOfficer(reportId, officerDetails); Assert.IsInstanceOfType(incidentOfficerId, typeof(Guid)); Assert.AreNotEqual(incidentOfficerId, Guid.Empty); // Find incident Gun section var incidentReportQueryService = GetDependency <IIncidentReportQueryService>(); Assert.IsInstanceOfType(incidentReportQueryService, typeof(IIncidentReportQueryService)); IncidentOfficer reportDetails = incidentReportQueryService.FindIncidentOfficer(incidentOfficerId); Assert.IsNotNull(reportDetails); Assert.AreEqual(incidentOfficerId, reportDetails.Id); Assert.AreEqual(officerDetails.OfficerName, reportDetails.OfficerName); }