Exemplo n.º 1
0
        public void IncidentSummaryQueryService_FindIncidentGun()
        {
            // 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 Gun
            Guid gunId = fICommandService.CreateIncidentGun(summaryId, MockObjects.NewIncidentGun);

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

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

            Assert.IsInstanceOfType(iSummaryQueryService, typeof(IIncidentSummaryQueryService));
            IncidentGun incidentGun = iSummaryQueryService.FindIncidentGun(gunId);

            Assert.IsNotNull(incidentGun);
        }
Exemplo n.º 2
0
        public void IncidentReportQueryService_FindIncidentGun()
        {
            // 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  incidentGunDetails = MockObjects.NewIncidentGun;
            Guid incidentGunId      = iCommandService.CreateIncidentGun(reportId, incidentGunDetails);

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

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

            Assert.IsInstanceOfType(incidentReportQueryService, typeof(IIncidentReportQueryService));
            IncidentGun reportDetails = incidentReportQueryService.FindIncidentGun(incidentGunId);

            Assert.IsNotNull(reportDetails);
            Assert.AreEqual(incidentGunId, reportDetails.Id);
            Assert.AreEqual(incidentGunDetails.BarrelLength, reportDetails.BarrelLength);
        }