Example #1
0
        public void IncidentSummaryQueryService_FindIncidentProperty()
        {
            // 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 Property
            Guid propertyId = fICommandService.CreateIncidentProperty(summaryId, MockObjects.NewIncidentProperty);

            Assert.IsInstanceOfType(propertyId, typeof(Guid));
            Assert.AreNotEqual(propertyId, Guid.Empty);

            // Find
            var iSummaryQueryService = GetDependency <IIncidentSummaryQueryService>();

            Assert.IsInstanceOfType(iSummaryQueryService, typeof(IIncidentSummaryQueryService));
            IncidentProperty incidentProperty = iSummaryQueryService.FindIncidentProperty(propertyId);

            Assert.IsNotNull(incidentProperty);
        }
Example #2
0
        public void IncidentReportQueryService_FindIncidentProperty()
        {
            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  propertyDetails    = MockObjects.NewIncidentProperty;
            Guid incidentPropertyId = iCommandService.CreateIncidentProperty(reportId, propertyDetails);

            Assert.IsInstanceOfType(incidentPropertyId, typeof(Guid));
            Assert.AreNotEqual(incidentPropertyId, Guid.Empty);

            // Find incident Gun section
            var incidentReportQueryService = GetDependency <IIncidentReportQueryService>();

            Assert.IsInstanceOfType(incidentReportQueryService, typeof(IIncidentReportQueryService));
            IncidentProperty reportDetails = incidentReportQueryService.FindIncidentProperty(incidentPropertyId);

            Assert.IsNotNull(reportDetails);
            Assert.AreEqual(incidentPropertyId, reportDetails.Id);
            Assert.AreEqual(propertyDetails.Quantity, reportDetails.Quantity);
        }