Example #1
0
        public override FakeRow Populate(GDID parentGdid)
        {
            int age = getFakeAge(parentGdid);

            ID          = parentGdid;
            Name        = NaturalTextGenerator.GenerateFullName(true);
            Age         = age;
            DOB         = DateTime.Now.AddYears(-age);
            Sex         = parentGdid.ID % 2 == 0 ? Sex.Male : Sex.Female;
            Income      = parentGdid.ID % 79 * 1000;
            Debt        = parentGdid.ID % 11 * 1000;
            Rating      = parentGdid.ID % 2 == 0 ? (double?)null : 3.25;
            Notes       = parentGdid.ToString();
            Voter       = parentGdid.ID % 2 == 0 ? (bool?)null : true;
            MilitarySvc = parentGdid.ID % 2 == 0 ? (bool?)null : false;
            Address1    = NaturalTextGenerator.GenerateAddressLine();
            Address2    = parentGdid.ID % 7 == 0 ? NaturalTextGenerator.GenerateAddressLine() : null;
            City        = NaturalTextGenerator.GenerateCityName();
            State       = "OH";
            Zip         = "44000" + parentGdid.ID % 999;
            Phone1      = "(555) 222-3222";
            Phone2      = parentGdid.ID % 3 == 0 ? "(555) 737-9789" : null;
            Email1      = NaturalTextGenerator.GenerateEMail();
            Email2      = parentGdid.ID % 5 == 0 ? NaturalTextGenerator.GenerateEMail() : null;
            URL         = parentGdid.ID % 2 == 0 ? "https://ibm.com/products/" + parentGdid.ID : null;
            Tags        = getFakeTags();
            return(this);
        }
Example #2
0
        protected override void DoHandleWork(WorkContext work)
        {
            var cnt    = work.MatchedVars["cnt"].AsInt(10);
            var pretty = work.MatchedVars["pretty"].AsBool(true);

            if (cnt > 10000)
            {
                cnt = 10000;
            }
            if (cnt < 0)
            {
                cnt = 1;
            }

            var lst = new List <object>();

            for (var i = 0; i < cnt; i++)
            {
                lst.Add(new {
                    FirstName  = NaturalTextGenerator.GenerateFirstName(),
                    MiddleName = NaturalTextGenerator.GenerateFirstName(),
                    LastName   = NaturalTextGenerator.GenerateLastName(),
                    Address    = "{0}\n{1}".Args(NaturalTextGenerator.GenerateAddressLine(),
                                                 NaturalTextGenerator.GenerateUSCityStateZip()),
                    Email = NaturalTextGenerator.GenerateEMail()
                });
            }

            work.Response.WriteJSON(lst, pretty ?
                                    NFX.Serialization.JSON.JSONWritingOptions.PrettyPrint :
                                    NFX.Serialization.JSON.JSONWritingOptions.Compact);
        }
Example #3
0
 public static N3_PartyAddress Make()
 {
     return(new N3_PartyAddress
     {
         AddressInformation1 = NaturalTextGenerator.GenerateAddressLine(),
         AddressInformation2 = NaturalTextGenerator.GenerateUSCityStateZip()
     });
 }
Example #4
0
 public static CommunicationNumber Make()
 {
     return(new CommunicationNumber
     {
         Communication_Number_Qualifier = "QW",
         Communication_Number = NaturalTextGenerator.GenerateEMail()
     });
 }
Example #5
0
 public static LQ_HealthCareRemarkCode Make()
 {
     return(new LQ_HealthCareRemarkCode
     {
         Code_List_Qualifier_Code = "QK",
         Industry_Code = NaturalTextGenerator.GenerateWord()
     });
 }
Example #6
0
 public static HumanName Build()
 {
     return(new HumanName
     {
         FirstName = NaturalTextGenerator.GenerateFirstName(),
         MiddleName = ExternalRandomGenerator.Instance.NextRandomInteger > 500000000 ? NaturalTextGenerator.GenerateFirstName() : null,
         LastName = NaturalTextGenerator.GenerateLastName()
     });
 }
Example #7
0
 public static AMT_ServiceSupplementalAmount Make()
 {
     return(new AMT_ServiceSupplementalAmount
     {
         Amount_Qualifier_Code = "SD",
         Monetary_Amount = ExternalRandomGenerator.Instance.AsDecimal(),
         Credit_Debit_Flag_Code = NaturalTextGenerator.GenerateWord()
     });
 }
Example #8
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);
     }
 }
Example #9
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)
     });
 }
Example #10
0
 public static TRN_ReassociationTraceNumber Make()
 {
     return(new TRN_ReassociationTraceNumber
     {
         Trace_Type_Code = "TT",
         Reference_Identification = NaturalTextGenerator.GenerateWord(),
         Originatin_Company_Identifier = NaturalTextGenerator.GenerateWord(),
         Reference_Identification2 = NaturalTextGenerator.GenerateWord()
     });
 }
Example #11
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)
     });
 }
Example #12
0
        private static string[] Generate(int arraySize)
        {
            var array = new string[arraySize];

            for (var index = 0; index < array.Length; index++)
            {
                array[index] = NaturalTextGenerator.GenerateFirstName();
            }
            return(array);
        }
Example #13
0
 public static TradingRec Build()
 {
     return(new TradingRec
     {
         Symbol = NaturalTextGenerator.GenerateFirstName(),
         Volume = ExternalRandomGenerator.Instance.NextScaledRandomInteger(-25000, 25000),
         Bet = ExternalRandomGenerator.Instance.NextScaledRandomInteger(-250000, 250000) * 10000L,
         Price = ExternalRandomGenerator.Instance.NextScaledRandomInteger(0, 1000000) * 10000L
     });
 }
Example #14
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)
     });
 }
Example #15
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);
     }
 }
Example #16
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()
     });
 }
Example #17
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);
 }
Example #18
0
 public static AccoungInfo Make()
 {
     return(new AccoungInfo
     {
         Account_Number = NaturalTextGenerator.GenerateWord(),
         Account_Number_Qualifier = "Q",
         DFI_Identification_Number = ExternalRandomGenerator.Instance.NextRandomInteger.ToString(),
         DFI_Number_Qualifier = "Q"
     });
 }
Example #19
0
 public void GenerateEMails()
 {
     for (var i = 0; i < 100; i++)
     {
         var txt = NaturalTextGenerator.GenerateEMail();
         Console.WriteLine(txt);
         Assert.IsTrue(txt.IsNotNullOrWhiteSpace());
         Assert.IsTrue(txt.Length >= 3);
         Assert.IsTrue(txt.Length <= 100);
     }
 }
Example #20
0
 public void GenerateUSCityStateZipNames()
 {
     for (var i = 0; i < 100; i++)
     {
         var txt = NaturalTextGenerator.GenerateUSCityStateZip();
         Console.WriteLine(txt);
         Assert.IsTrue(txt.IsNotNullOrWhiteSpace());
         Assert.IsTrue(txt.Length >= 3);
         Assert.IsTrue(txt.Length <= 50);
     }
 }
Example #21
0
 public void GenerateFulltNames_withMiddle()
 {
     for (var i = 0; i < 100; i++)
     {
         var txt = NaturalTextGenerator.GenerateFullName(true);
         Console.WriteLine(txt);
         Assert.IsTrue(txt.IsNotNullOrWhiteSpace());
         Assert.IsTrue(txt.Length >= 6);
         Assert.IsTrue(txt.Length <= 40);
     }
 }
Example #22
0
 public override FakeRow Populate(GDID parentGdid)
 {
     ID         = parentGdid;
     Name       = NaturalTextGenerator.GenerateWord(5, 8) + NaturalTextGenerator.GenerateWord(5, 8) + ".txt";
     FullName   = $@"c:\{NaturalTextGenerator.GenerateWord(5, 12)}\{NaturalTextGenerator.GenerateWord(3, 8)}\{Name}";
     Host       = $"127.0.0.{Ambient.Random.NextScaledRandomInteger(1, 20)}";
     FileId     = Guid.NewGuid();
     CreateDate = DateTime.Now.AddHours(Ambient.Random.NextScaledRandomInteger(1, 12)).AddMinutes(Ambient.Random.NextScaledRandomInteger(1, 60));
     Length     = Ambient.Random.NextRandomUnsignedLong;
     return(this);
 }
Example #23
0
 public void GenerateCityNames()
 {
     for (var i = 0; i < 100; i++)
     {
         var txt = NaturalTextGenerator.GenerateCityName();
         Console.WriteLine(txt);
         Aver.IsTrue(txt.IsNotNullOrWhiteSpace());
         Aver.IsTrue(txt.Length >= 3);
         Aver.IsTrue(txt.Length <= 40);
     }
 }
Example #24
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)
     });
 }
Example #25
0
 //makes fake weather data for the day
 private WeatherDay makeFake(DateTime when, string area)
 {
     return(new WeatherDay
     {
         AsOfDate = when,
         LocalityName = "{0} near {1}".Args(area, NaturalTextGenerator.GenerateCityName()),
         PrecipitationChance = ExternalRandomGenerator.Instance.NextScaledRandomInteger(0, 100),
         TemperatureLowF = ExternalRandomGenerator.Instance.NextScaledRandomInteger(42, 50),
         TemperatureHighF = ExternalRandomGenerator.Instance.NextScaledRandomInteger(62, 74),
     });
 }
Example #26
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);
     }
 }
Example #27
0
 public void GenerateDefaultWordSizes()
 {
     for (var i = 0; i < 100; i++)
     {
         var txt = NaturalTextGenerator.GenerateWord();
         Console.WriteLine(txt);
         Assert.IsTrue(txt.IsNotNullOrWhiteSpace());
         Assert.IsTrue(txt.Length >= 4);
         Assert.IsTrue(txt.Length <= 20);
     }
 }
Example #28
0
 public void GenerateWordSizes(int min, int max)
 {
     for (var i = 0; i < 100; i++)
     {
         var txt = NaturalTextGenerator.GenerateWord(min, max);
         Console.WriteLine(txt);
         Assert.IsTrue(txt.IsNotNullOrWhiteSpace());
         Assert.IsTrue(txt.Length >= min);
         Assert.IsTrue(txt.Length <= max);
     }
 }
Example #29
0
 public static PER_PartyContactInformation Make()
 {
     return(new PER_PartyContactInformation
     {
         Contact_Function_Code = "RP",
         Name = NaturalTextGenerator.GenerateFirstName(),
         CommunicationNumber1 = CommunicationNumber.Make(),
         CommunicationNumber2 = CommunicationNumber.Make(),
         CommunicationNumber3 = CommunicationNumber.Make(),
         Contact_Inquiry_Reference = NaturalTextGenerator.GenerateWord()
     });
 }
Example #30
0
 public static N1_PartyIdentification Make()
 {
     return(new N1_PartyIdentification
     {
         Entity_Identifier_Code = "TY",
         Name = NaturalTextGenerator.GenerateFullName(),
         Identification_Code_Qualifier = "CU",
         Identification_Code = NaturalTextGenerator.GenerateWord(),
         Entity_Relationship_Code = NaturalTextGenerator.GenerateWord(),
         Entity_Identifier_Code2 = NaturalTextGenerator.GenerateWord()
     });
 }