Exemplo n.º 1
0
 public void GenerateDefault()
 {
     for (var i = 0; i < 100; i++)
     {
         var txt = NaturalTextGenerator.Generate();
         Console.WriteLine(txt);
         Aver.IsTrue(txt.IsNotNullOrWhiteSpace());
         Aver.IsTrue(txt.Length > 4);
     }
 }
Exemplo n.º 2
0
 public static REF_Identification Make()
 {
     return(new REF_Identification
     {
         Reference_Identification_Qualifier = "RF",
         Reference_Identification = NaturalTextGenerator.GenerateWord(),
         Description = NaturalTextGenerator.Generate(50),
         Description2 = NaturalTextGenerator.Generate(20)
     });
 }
Exemplo n.º 3
0
 public static QTY_ServiceSupplementalQuantity Make()
 {
     return(new QTY_ServiceSupplementalQuantity
     {
         Quantity_Qualifier = "DG",
         Quantity = ExternalRandomGenerator.Instance.AsInt(),
         Info = NaturalTextGenerator.Generate(15),
         Description = NaturalTextGenerator.Generate(35)
     });
 }
Exemplo n.º 4
0
 public static QTY_ClaimSupplementalInformationQuantity Make()
 {
     return(new QTY_ClaimSupplementalInformationQuantity
     {
         Quantity_Qualifier = "QQ",
         Quantity = ExternalRandomGenerator.Instance.AsDecimal(),
         Description = NaturalTextGenerator.Generate(),
         Free_form_Information = NaturalTextGenerator.Generate()
     });
 }
Exemplo n.º 5
0
 public override FakeRow Populate(GDID parentGdid)
 {
     ID       = parentGdid;
     From     = $"{Ambient.Random.NextScaledRandomInteger(200, 999)}{Ambient.Random.NextScaledRandomInteger(100, 999)}{Ambient.Random.NextScaledRandomInteger(0, 9999):D4}";
     To       = $"{Ambient.Random.NextScaledRandomInteger(200, 999)}{Ambient.Random.NextScaledRandomInteger(100, 999)}{Ambient.Random.NextScaledRandomInteger(0, 9999):D4}";
     Host     = $"127.0.0.{Ambient.Random.NextScaledRandomInteger(1, 20)}";
     Body     = NaturalTextGenerator.Generate(50);
     SentDate = DateTime.Now.AddHours(Ambient.Random.NextScaledRandomInteger(1, 12)).AddMinutes(Ambient.Random.NextScaledRandomInteger(1, 60));
     return(this);
 }
Exemplo n.º 6
0
 public static REF_AdditionalPartyIdentification Make()
 {
     return(new REF_AdditionalPartyIdentification
     {
         Reference_Identification_Qualifier = "QU",
         Reference_Identification = NaturalTextGenerator.GenerateWord(),
         Description = NaturalTextGenerator.Generate(70),
         Description2 = NaturalTextGenerator.Generate(30)
     });
 }
Exemplo n.º 7
0
 public void GenerateRandomSizes()
 {
     for (var i = 0; i < 100; i++)
     {
         var txt = NaturalTextGenerator.Generate(0);
         Console.WriteLine(txt);
         Assert.IsTrue(txt.IsNotNullOrWhiteSpace());
         Assert.IsTrue(txt.Length > 4);
     }
 }
Exemplo n.º 8
0
 public static RDM_RemittanceDeliveryMethod Make()
 {
     return(new RDM_RemittanceDeliveryMethod
     {
         Report_Transmission_Code = NaturalTextGenerator.GenerateWord(),
         Name = NaturalTextGenerator.GenerateFullName(),
         Communication_Number = NaturalTextGenerator.GenerateEMail(),
         Info1 = NaturalTextGenerator.Generate(50),
         Info2 = NaturalTextGenerator.Generate(20)
     });
 }
Exemplo n.º 9
0
 public void GenerateUpToSize(int sz)
 {
     for (var i = 0; i < 100; i++)
     {
         var txt = NaturalTextGenerator.Generate(sz);
         Console.WriteLine(txt);
         Assert.IsTrue(txt.IsNotNullOrWhiteSpace());
         Assert.IsTrue(txt.Length > 0);
         Assert.IsTrue(txt.Length <= sz);
     }
 }
Exemplo n.º 10
0
        public static BankMsg Build()
        {
            var rnd = ExternalRandomGenerator.Instance.NextRandomInteger;

            return(new BankMsg
            {
                FIPSCode = NaturalTextGenerator.Generate(20),
                HCFACode = NaturalTextGenerator.Generate(20),
                LANGRARCode = 1239872633238L,
                IsChargeable = true
            });
        }
Exemplo n.º 11
0
 public static SVC_ServicePaymentInformation Make()
 {
     return(new SVC_ServicePaymentInformation
     {
         Qualifier = "SC",
         Monetary_Amount = ExternalRandomGenerator.Instance.AsDecimal(),
         Monetary_Amount2 = ExternalRandomGenerator.Instance.AsDecimal(),
         Product_Service_ID = NaturalTextGenerator.GenerateWord(),
         Quantity = ExternalRandomGenerator.Instance.AsDecimal(),
         Description = NaturalTextGenerator.Generate(),
         Quantity2 = ExternalRandomGenerator.Instance.AsDecimal()
     });
 }
Exemplo n.º 12
0
        public override FakeRow Populate(GDID parentGdid)
        {
            ID            = parentGdid;
            DeviceId      = Ambient.Random.NextScaledRandomInteger(1, 10_000);
            Latitude      = Math.Round(Ambient.Random.NextScaledRandomDouble(-80, 80), 4);
            Longitude     = Math.Round(Ambient.Random.NextScaledRandomDouble(-180, 180), 4);
            CreateDate    = DateTime.Now.AddHours(Ambient.Random.NextScaledRandomInteger(1, 12)).AddMinutes(Ambient.Random.NextScaledRandomInteger(1, 60));
            CorrelationId = Guid.NewGuid();
            PartNumber    = Ambient.Random.NextScaledRandomInteger(2, int.MaxValue);
            Note          = NaturalTextGenerator.Generate(50);
            Amt           = new Amount("usd", (decimal)Ambient.Random.NextScaledRandomDouble(0, 1_000_000D));

            return(this);
        }
Exemplo n.º 13
0
 public override FakeRow Populate(GDID parentGdid)
 {
     ID          = parentGdid;
     DisplayName = NaturalTextGenerator.GenerateFullName(true);
     FromEmail   = NaturalTextGenerator.GenerateEMail();
     ToEmail     = NaturalTextGenerator.GenerateEMail();
     CcEmail     = parentGdid.ID % 5 == 0 ? NaturalTextGenerator.GenerateEMail() : null;
     BccEmail    = parentGdid.ID % 10 == 0 ? NaturalTextGenerator.GenerateEMail() : null;
     Host        = $"127.0.0.{Ambient.Random.NextScaledRandomInteger(1, 20)}";
     Tags        = getFakeTags();
     SentDate    = DateTime.Now.AddHours(Ambient.Random.NextScaledRandomInteger(1, 12)).AddMinutes(Ambient.Random.NextScaledRandomInteger(1, 60));
     Subject     = NaturalTextGenerator.Generate(50);
     Body        = NaturalTextGenerator.Generate(0);
     return(this);
 }
            public static RPCMessage Generate()
            {
                var rnd = ExternalRandomGenerator.Instance.NextRandomInteger;
                var msg = new RPCMessage
                {
                    RequestID           = Guid.NewGuid(),
                    TypeName            = NaturalTextGenerator.Generate(80),
                    MethodName          = NaturalTextGenerator.Generate(30),
                    MethodID            = rnd % 25,
                    RemoteInstance      = (0 != (rnd & (1 << 32))) ? Guid.NewGuid() : (Guid?)null,
                    RequiredReliability = (0 != (rnd & (1 << 31))) ? rnd / 100d : (double?)null,
                    WrapException       = (0 != (rnd & (1 << 30))),
                    ElevatePermission   = (0 != (rnd & (1 << 29))),
                    CallArguments       = new object[ExternalRandomGenerator.Instance.NextScaledRandomInteger(0, 6)]
                };

                for (var i = 0; i < msg.CallArguments.Length; i++)
                {
                    var r = ExternalRandomGenerator.Instance.NextScaledRandomInteger(0, 4);
                    switch (r)
                    {
                    case 1:
                        msg.CallArguments[i] = BankMsg.Generate();
                        break;

                    case 2:
                        msg.CallArguments[i] = NaturalTextGenerator.Generate();
                        break;

                    case 3:
                        msg.CallArguments[i] = null;     //new byte[16]; Protobuf does not support byte via object
                        break;

                    default:
                        msg.CallArguments[i] = AddressMessage.Build();
                        break;
                    }
                }

                return(msg);
            }
Exemplo n.º 15
0
 public static CUR_ForeignCurrencyInformation Make()
 {
     return(new CUR_ForeignCurrencyInformation
     {
         Entity_Identifier_Code = "CU",
         Currency_Code = "CAD",
         Exchange_Rate = "1.25",
         Entity_Identifier_Code2 = NaturalTextGenerator.Generate(3),
         Currency_Code2 = "USD",
         Currency_Market_Exchange_Code = "FX",
         CUR_DateTimes = new List <CUR_DateTime>
         {
             CUR_DateTime.Make(),
             CUR_DateTime.Make(),
             CUR_DateTime.Make(),
             CUR_DateTime.Make(),
             CUR_DateTime.Make(),
             CUR_DateTime.Make(),
             CUR_DateTime.Make(),
             CUR_DateTime.Make()
         }
     });
 }
Exemplo n.º 16
0
        public static TypicalPersonData MakeRandom()
        {
            var rnd = ExternalRandomGenerator.Instance.NextRandomInteger;

            var data = new TypicalPersonData
            {
                FirstName  = NaturalTextGenerator.GenerateFirstName(),
                MiddleName =
                    ExternalRandomGenerator.Instance.NextRandomInteger > 500000000
                        ? NaturalTextGenerator.GenerateFirstName()
                        : null,
                LastName         = NaturalTextGenerator.GenerateLastName(),
                DOB              = DateTime.Now.AddYears(ExternalRandomGenerator.Instance.NextScaledRandomInteger(-90, -1)),
                Salary           = ExternalRandomGenerator.Instance.NextScaledRandomInteger(30, 250) * 1000m,
                YearsOfService   = 25,
                CreditScore      = 0.7562,
                RegisteredToVote = (DateTime.UtcNow.Ticks & 1) == 0,
                MaritalStatus    = MaritalStatus.HatesAll,
                Address1         = NaturalTextGenerator.GenerateAddressLine(),
                Address2         = NaturalTextGenerator.GenerateAddressLine(),
                AddressCity      = NaturalTextGenerator.GenerateCityName(),
                AddressState     = "CA",
                AddressZip       = "91606",
                HomePhone        = (DateTime.UtcNow.Ticks & 1) == 0 ? "(555) 123-4567" : null,
                EMail            = NaturalTextGenerator.GenerateEMail()
            };

            if (0 != (rnd & (1 << 32)))
            {
                data.Notes = NaturalTextGenerator.Generate(45);
            }
            if (0 != (rnd & (1 << 31)))
            {
                data.SkypeID = NaturalTextGenerator.GenerateEMail();
            }
            if (0 != (rnd & (1 << 30)))
            {
                data.YahooID = NaturalTextGenerator.GenerateEMail();
            }

            if (0 != (rnd & (1 << 29)))
            {
                data.IsSmoker = 0 != (rnd & (1 << 17));
            }
            if (0 != (rnd & (1 << 28)))
            {
                data.IsLoving = 0 != (rnd & (1 << 16));
            }
            if (0 != (rnd & (1 << 27)))
            {
                data.IsLoved = 0 != (rnd & (1 << 15));
            }
            if (0 != (rnd & (1 << 26)))
            {
                data.IsDangerous = 0 != (rnd & (1 << 14));
            }
            if (0 != (rnd & (1 << 25)))
            {
                data.IsEducated = 0 != (rnd & (1 << 13));
            }

            if (0 != (rnd & (1 << 24)))
            {
                data.LastSmokingDate = DateTime.Now.AddYears(-10);
            }


            if (0 != (rnd & (1 << 23)))
            {
                data.DesiredSalary = rnd / 1000m;
            }
            if (0 != (rnd & (1 << 22)))
            {
                data.ProbabilityOfSpaceFlight = rnd / (double)int.MaxValue;
            }

            if (0 != (rnd & (1 << 21)))
            {
                data.CurrentFriendCount = rnd % 123;
                data.DesiredFriendCount = rnd % 121000;
            }

            return(data);
        }
Exemplo n.º 17
0
        //   public object SomeObject;

        public static TypicalPersonData MakeRandom(bool extraData = false)
        {
            var rnd = ExternalRandomGenerator.Instance.NextRandomInteger;

            var data = new TypicalPersonData
            {
                FirstName        = NaturalTextGenerator.GenerateFirstName(),
                MiddleName       = ExternalRandomGenerator.Instance.NextRandomInteger > 500000000 ? NaturalTextGenerator.GenerateFirstName() : null,
                LastName         = NaturalTextGenerator.GenerateLastName(),
                DOB              = DateTime.Now.AddYears(ExternalRandomGenerator.Instance.NextScaledRandomInteger(-90, -1)),
                Salary           = ExternalRandomGenerator.Instance.NextScaledRandomInteger(30, 250) * 1000m,
                YearsOfService   = 25,
                CreditScore      = 0.7562,
                RegisteredToVote = (DateTime.UtcNow.Ticks & 1) == 0,
                MaritalStatus    = MaritalStatus.HatesAll,
                Address1         = NaturalTextGenerator.GenerateAddressLine(),
                Address2         = NaturalTextGenerator.GenerateAddressLine(),
                AddressCity      = NaturalTextGenerator.GenerateCityName(),
                AddressState     = "CA",
                AddressZip       = "91606",
                HomePhone        = (DateTime.UtcNow.Ticks & 1) == 0 ? "(555) 123-4567" : null,
                EMail            = NaturalTextGenerator.GenerateEMail()
            };

            //if (extraData)
            //  data.SomeObject = new Dictionary<object, object>
            //  {
            //    { "1aaaaa", TypicalPersonData.MakeRandom(false)}, { 2212, -234123}, {13000,100}, { Tuple.Create(2, false,true), "yes"}, {"4aaa",'a'},
            //    { "a2aaaa", TypicalPersonData.MakeRandom(false)}, { 132, TypicalPersonData.MakeRandom(false)}, {130400,100}, { Tuple.Create(3, false,true), "yes"}, {"a234aa",'a'},
            //    { "aa4aaa", TypicalPersonData.MakeRandom(false)}, { 412, -123}, {2100d,100L}, { Tuple.Create(4, false,TypicalPersonData.MakeRandom(false)), "yes"}, {"a5aa",'a'},
            //    { "aa3aaa", TypicalPersonData.MakeRandom(false)}, { 212, 0}, {1222200m,100}, { Tuple.Create(5, false,true), "yes"}, {"a43aa1",'a'},
            //    { "a5aaaa", TypicalPersonData.MakeRandom(false)}, { 512, new int[]{1,2,-3,4,5,-6,-1,-2,-3,-4,5,6,1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,4,5,60}},
            //    {102200,100}, { Tuple.Create(-213232d, false,false), "yes"}, {"222222222222aaa",'a'},
            //  };

            if (0 != (rnd & (1 << 32)))
            {
                data.Notes = NaturalTextGenerator.Generate(45);
            }
            if (0 != (rnd & (1 << 31)))
            {
                data.SkypeID = NaturalTextGenerator.GenerateEMail();
            }
            if (0 != (rnd & (1 << 30)))
            {
                data.YahooID = NaturalTextGenerator.GenerateEMail();
            }

            if (0 != (rnd & (1 << 29)))
            {
                data.IsSmoker = 0 != (rnd & (1 << 17));
            }
            if (0 != (rnd & (1 << 28)))
            {
                data.IsLoving = 0 != (rnd & (1 << 16));
            }
            if (0 != (rnd & (1 << 27)))
            {
                data.IsLoved = 0 != (rnd & (1 << 15));
            }
            if (0 != (rnd & (1 << 26)))
            {
                data.IsDangerous = 0 != (rnd & (1 << 14));
            }
            if (0 != (rnd & (1 << 25)))
            {
                data.IsEducated = 0 != (rnd & (1 << 13));
            }

            if (0 != (rnd & (1 << 24)))
            {
                data.LastSmokingDate = DateTime.Now.AddYears(-10);
            }


            if (0 != (rnd & (1 << 23)))
            {
                data.DesiredSalary = rnd / 1000m;
            }
            if (0 != (rnd & (1 << 22)))
            {
                data.ProbabilityOfSpaceFlight = rnd / (double)int.MaxValue;
            }

            if (0 != (rnd & (1 << 21)))
            {
                data.CurrentFriendCount = rnd % 123;
                data.DesiredFriendCount = rnd % 121000;
            }


            return(data);
        }