Ejemplo n.º 1
0
 PartnerAggregate GenerateRandomAggregate()
 {
     var graph = new PartnerAggregate
     {
         Id = Guid.NewGuid(),
         Name = StringExtension.RandomString(),
         Phone = StringExtension.RandomString(),
         Email = StringExtension.RandomString(),
         Url = StringExtension.RandomString(),
         Deleted = new Random().Next(),
         TimeZoneId = Guid.NewGuid(),
         LanguageId = Guid.NewGuid(),
         LocationId = Guid.NewGuid(),
         PartnerChainId = Guid.NewGuid(),
         CurrencyId = Guid.NewGuid(),
         TaxClass = StringExtension.RandomString(1),
         SapCode = StringExtension.RandomString(),
         TimeStamp =  DateTimeOffset.Now
     };
     graph.PartnerChain = new PartnerChain
     {
         Id = graph.PartnerChainId.Value,
         Name = StringExtension.RandomString(),
         SapCode = StringExtension.RandomString(),
         TimeStamp = DateTimeOffset.Now
     };
     
     return graph;
 }
Ejemplo n.º 2
0
 BaseEvent GenerateMessage(PartnerAggregate aggregate)
 {
     var serializedAggregate = new JsonSerializer().Serialize<PartnerAggregate>(aggregate);
     return new BaseEvent
     {
         EventID = Guid.NewGuid(),
         MessageOriginator = "Tester",
         MessageType = typeof(RegisteredPartner).Name,
         Topic = "Service",
         Aggregate = new CryptoManager().Encrypt(serializedAggregate, HostPasswordConfigFake.GetHostPassword())
     };
 }