Пример #1
0
        public void IncidentSummaryQueryService_FindIncidentEvent()
        {
            // 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 Incident Event
            Guid eventId = fICommandService.CreateIncidentEvent(summaryId, MockObjects.NewIncidentEvent);

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

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

            Assert.IsInstanceOfType(iSummaryQueryService, typeof(IIncidentSummaryQueryService));
            IncidentEvent incidentEvent = iSummaryQueryService.FindIncidentEvent(eventId);

            Assert.IsNotNull(incidentEvent);
        }
        private void SetUpIncidentEvent()
        {
            var incidentEvent = new IncidentEvent(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid());

            _summariesUnitOfWork.Setup(mock => mock.Find <IncidentEvent>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>()))
            .Returns(incidentEvent);
            _incidentSummary.Event = incidentEvent;
            _incidentEventId       = incidentEvent.Id;
        }
        public void FindIncidentEventReportId()
        {
            var incidentEvent = new IncidentEvent(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid());

            _incidentReport.IncidentEvent = incidentEvent;
            var incidentEventReportId = _incidentReportQueryService.FindIncidentReportId(incidentEvent.Id);

            incidentEventReportId.Should().NotBeEmpty();
            Assert.AreEqual(_incidentReport.Id, incidentEventReportId);
        }
Пример #4
0
    static void Main(string[] args)
    {
        IncidentEvent xmlObj = new IncidentEvent()
        {
            EventDate     = "2012.12.01",
            EventTime     = "1:00:00",
            EventTypeText = "Beginining"
        };
        XmlSerializerNamespaces ns = new XmlSerializerNamespaces();

        ns.Add("ett", "http://foo");
        XmlSerializer serializer = new XmlSerializer(typeof(IncidentEvent));

        serializer.Serialize(Console.OpenStandardOutput(), xmlObj, ns);
        Console.WriteLine();
    }
Пример #5
0
 public ResolveEvent(IncidentEvent incident, string desc)
 {
     service_key = incident.service_key;
     incident_key = incident.incident_key;
     description = desc;
 }
 public AcknowledgeEvent(IncidentEvent incident, string desc)
 {
     service_key = incident.service_key;
     incident_key = incident.incident_key;
     description = desc;
 }
Пример #7
0
 public static string ToString(IncidentEvent ie)
 {
     return(ie.ToString() + "PrefabV2");
 }