DeviceAggregate GenerateRandomAggregate()
 {
     var graph = new DeviceAggregate
     {
         Id = Guid.NewGuid(),
         DescriptionKeyId = StringExtension.RandomString(33),
         SerialNumber = StringExtension.RandomString(17),
         MachineId = Guid.NewGuid(),
         DeviceGroupId = Guid.NewGuid(),
         SapCode = StringExtension.RandomString(10),
         TimeStamp = DateTimeOffset.Now
     };
     graph.DeviceGroup = new DeviceGroup
     {
         Id = graph.DeviceGroupId,
         NameKeyId = StringExtension.RandomString(30),
         DeviceTypeId = Guid.NewGuid(),
         SapCode = StringExtension.RandomString(19),
         TimeStamp = DateTimeOffset.Now
     };
     graph.DeviceGroup.DeviceType = new DeviceType
     {
         Id = graph.DeviceGroup.DeviceTypeId,
         NameKeyId = StringExtension.RandomString(30),
         SapCode = StringExtension.RandomString(12),
         TimeStamp = DateTimeOffset.Now
     };
     
     return graph;
 }
 BaseEvent GenerateMessage(DeviceAggregate aggregate)
 {
     var serializedAggregate = new JsonSerializer().Serialize<DeviceAggregate>(aggregate);
     return new BaseEvent
     {
         EventID = Guid.NewGuid(),
         MessageOriginator = "Tester",
         MessageType = typeof(RegisteredDevice).Name,
         Topic = "Service",
         Aggregate = new CryptoManager().Encrypt(serializedAggregate, HostPasswordConfigFake.GetHostPassword())
     };
 }