Пример #1
0
        public void IncidentSummaryQueryService_FindIncidentPersonOther()
        {
            // 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 PersonOtherId
            Guid personOtherId = fICommandService.CreateIncidentPersonOther(summaryId, MockObjects.NewIncidentPersonOther);

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

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

            Assert.IsInstanceOfType(iSummaryQueryService, typeof(IIncidentSummaryQueryService));
            IncidentPersonOther incidentPersonOther = iSummaryQueryService.FindIncidentPersonOther(personOtherId);

            Assert.IsNotNull(incidentPersonOther);
        }
Пример #2
0
        public void IncidentReportQueryService_FindIncidentPersonOther()
        {
            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  personOtherDetails    = MockObjects.NewIncidentPersonOther;
            Guid incidentPersonOtherId = iCommandService.CreateIncidentPersonOther(reportId, personOtherDetails);

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

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

            Assert.IsInstanceOfType(incidentReportQueryService, typeof(IIncidentReportQueryService));
            IncidentPersonOther reportDetails = incidentReportQueryService.FindIncidentPersonOther(incidentPersonOtherId);

            Assert.IsNotNull(reportDetails);
            Assert.AreEqual(incidentPersonOtherId, reportDetails.Id);
            Assert.AreEqual(personOtherDetails.FirstName, reportDetails.FirstName);
        }