예제 #1
0
        public void IncidentSummaryQueryService_FindIncidentDrug()
        {
            // 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 Drug
            Guid drugId = fICommandService.CreateIncidentDrug(summaryId, MockObjects.NewIncidentDrug);

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

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

            Assert.IsInstanceOfType(iSummaryQueryService, typeof(IIncidentSummaryQueryService));
            IncidentDrug incidentDrug = iSummaryQueryService.FindIncidentDrug(drugId);

            Assert.IsNotNull(incidentDrug);
        }
예제 #2
0
        public void IncidentReportQueryService_FindIncidentDrug()
        {
            // 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 Drug section
            var  incidentDrugDetails = MockObjects.NewIncidentDrug;
            Guid incidentDrugId      = iCommandService.CreateIncidentDrug(reportId, incidentDrugDetails);

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

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

            Assert.IsInstanceOfType(incidentReportQueryService, typeof(IIncidentReportQueryService));
            IncidentDrug reportDetails = incidentReportQueryService.FindIncidentDrug(incidentDrugId);

            Assert.IsNotNull(reportDetails);
            Assert.AreEqual(incidentDrugId, reportDetails.Id);
            Assert.AreEqual(incidentDrugDetails.DrugType, reportDetails.DrugType);
        }