예제 #1
0
        SessionAggregate GenerateRandomAggregate()
        {
            var sessionGraph = new SessionAggregate
            {
                Id = Guid.NewGuid(),
                EndTime = DateTimeOffset.Now.AddDays(-1),
                InitialTime = DateTimeOffset.Now.AddDays(-2),
                InvoiceId = Guid.NewGuid(),
                InterpretationDone = new Random().Next(0, 100) > 50,
                SignedDate = DateTimeOffset.Now,
                GuardianId = Guid.NewGuid(),
                PartnerId = Guid.NewGuid(),
                PatientId = Guid.NewGuid(),
                PayableId = Guid.NewGuid(),
                ServiceId = Guid.NewGuid(),
                ServiceLevelId = Guid.NewGuid(),
                MediaId = Guid.NewGuid(),
                MachineId = Guid.NewGuid(),
                CommissionId = Guid.NewGuid()
            };

            sessionGraph.Appointment = new List<Appointment>
            {
                new Appointment
                {
                    Id =  Guid.NewGuid(),
                    InitialTime = DateTime.Now.AddDays(-2),
                    FinalTime = DateTime.Now.AddDays(-1),
                    MachineId =  Guid.NewGuid(),
                    MediaId =  Guid.NewGuid(),
                    PartnerId =  Guid.NewGuid(),
                    PatientId =  Guid.NewGuid(),
                    PayableId =  Guid.NewGuid(),
                    ServiceId =  Guid.NewGuid(),
                    ServiceLevelId =  Guid.NewGuid(),
                    ServiceTypeId =  Guid.NewGuid(),
                    SessionId = sessionGraph.Id,
                    StatusType = new Random().Next(),
                    TimeStamp = DateTimeOffset.Now,
                    TimeZoneId = Guid.NewGuid()
                }
            };

            sessionGraph.SessionDevice = new List<SessionDevice>
            {
                new SessionDevice
                {
                    Id = Guid.NewGuid(),
                    SerialNumber = StringExtension.RandomString(17),
                    SapCode =  StringExtension.RandomString(20),
                    DeviceGroup =  StringExtension.RandomString(10),
                    DeviceId = Guid.NewGuid(),
                    SessionId = sessionGraph.Id
                }
            };

            sessionGraph.Diagnosis = new List<Diagnosis>
            {
                new Diagnosis
                {
                    Id = Guid.NewGuid(),
                    Name = StringExtension.RandomString(10),
                    Appraisal = StringExtension.RandomString(10),
                    TimeStamp =  DateTimeOffset.Now,
                    SessionId = sessionGraph.Id
                }
            };

            return sessionGraph;
        }
예제 #2
0
 BaseEvent GenerateMessage(SessionAggregate aggregate)
 {
     
     var serializedAggregate = new JsonSerializer().Serialize<SessionAggregate>(aggregate);
     return new BaseEvent
     {
         EventID = Guid.NewGuid(),
         MessageOriginator = "Tester",
         MessageType = typeof(FinisedEvaSession).Name,
         Topic = "Session",
         Aggregate = new CryptoManager().Encrypt(serializedAggregate, HostPasswordConfigFake.GetHostPassword())
     };
 }