Example #1
0
        public void IncidentSummaryQueryService_FindIncidentPersonSuspect()
        {
            // 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 PersonSuspect
            Guid personSuspectId = fICommandService.CreateIncidentPersonSuspect(summaryId, MockObjects.NewIncidentPersonSuspect);

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

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

            Assert.IsInstanceOfType(iSummaryQueryService, typeof(IIncidentSummaryQueryService));
            IncidentPersonSuspect incidentpersonSuspect = iSummaryQueryService.FindIncidentPersonSuspect(personSuspectId);

            Assert.IsNotNull(incidentpersonSuspect);
        }
Example #2
0
        public void IncidentReportQueryService_FindIncidentPersonSuspect()
        {
            // 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 Gun section
            var  personSuspectDetails    = MockObjects.NewIncidentPersonSuspect;
            Guid incidentPersonSuspectId = iCommandService.CreateIncidentPersonSuspect(reportId, personSuspectDetails);

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

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

            Assert.IsInstanceOfType(incidentReportQueryService, typeof(IIncidentReportQueryService));
            IncidentPersonSuspect reportDetails = incidentReportQueryService.FindIncidentPersonSuspect(incidentPersonSuspectId);

            Assert.IsNotNull(reportDetails);
            Assert.AreEqual(incidentPersonSuspectId, reportDetails.Id);
            Assert.AreEqual(personSuspectDetails.FirstName, reportDetails.FirstName);
            Assert.AreEqual(personSuspectDetails.JcaNumber, reportDetails.JcaNumber);
        }
        private void SetUpIncidentPersonSuspect()
        {
            var incidentPersonSuspect = new IncidentPersonSuspect(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid());

            _summariesUnitOfWork.Setup(mock => mock.Find <IncidentPersonSuspect>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(incidentPersonSuspect);
            _incidentSummary.People.Add(incidentPersonSuspect);
            _incidentPersonSuspectId = incidentPersonSuspect.Id;
        }
        public void FindIncidentPersonSuspect()
        {
            var incidentPersonSuspect = new IncidentPersonSuspect(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid());

            _reportsUnitOfWork.Setup(mock => mock.Find <IncidentPersonSuspect>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>())).Returns(incidentPersonSuspect);
            var incidentPersonSuspectReport = _incidentReportQueryService.FindIncidentPersonSuspect(It.IsAny <Guid>());

            incidentPersonSuspectReport.Should().NotBeNull();
        }
        public void FindIncidentPersonSuspectReportId()
        {
            var incidentPersonSuspect = new IncidentPersonSuspect(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid());

            _incidentReport.People.Add(incidentPersonSuspect);
            var incidentPersonSuspectReportId = _incidentReportQueryService.FindIncidentPersonSuspectReportId(incidentPersonSuspect.Id);

            incidentPersonSuspectReportId.Should().NotBeEmpty();
            Assert.AreEqual(_incidentReport.Id, incidentPersonSuspectReportId);
        }
Example #6
0
        public void GetRelatedOffenders()
        {
            var incidentPersonSuspect = new IncidentPersonSuspect(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid());

            _report.People.Add(incidentPersonSuspect);
            _summary.People.Add(incidentPersonSuspect);
            var relatedNames = _relatedToService.GetRelatedOffenders(_report.Number, _report.AgencyId);

            relatedNames.Should().NotBeEmpty();
            relatedNames.Should().HaveCount(2);
            relatedNames.Should().BeOfType(typeof(List <RelatedName>));
            _reportsUnitOfWork.VerifyAll();
            _summariesUnitOfWork.VerifyAll();
        }
Example #7
0
 private void SetUpIncidentPersonSuspect()
 {
     _incidentPersonSuspect = new IncidentPersonSuspect(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid());
     _reportsUnitOfWork.Setup(mock => mock.Find <IncidentPersonSuspect>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
     .Returns(_incidentPersonSuspect);
 }