public static MsgBatchingW Generate(int msgCount, MsgBatchingType msgType) { var msgBatching = new MsgBatchingW(); if (msgCount < 1) { msgCount = 1; } msgBatching.Data = new List <object>(msgCount); for (var i = 0; i < msgCount; i++) { msgBatching.Data.Add(msgType == MsgBatchingType.Personal ? SomePersonalDataMessage.Build() : msgType == MsgBatchingType.RPC ? RPCMessage.Generate() : msgType == MsgBatchingType.Trading ? (object)TradingRec.Generate() : EDI_X12_835W.Generate() ); } return(msgBatching); }
public static SomePersonalDataMessage Build() { var rnd = ExternalRandomGenerator.Instance.NextRandomInteger; var primaryAddr = AddressMessage.Build(); var data = new SomePersonalDataMessage { ID = Guid.NewGuid(), LegalName = HumanName.Build(), RegistrationName = HumanName.Build(), RegistrationDate = DateTime.Now.AddDays(-23), Residence = primaryAddr, Shipping = primaryAddr, Billing = primaryAddr, StageAccessCode = new byte[32], SpeakerAccessCode = new byte[32], YearsInSchool = (0 != (rnd & (1 << 29))) ? 10 : (int?)null, EducationGrade = (0 != (rnd & (1 << 28))) ? 230 : (int?)null, AssetsAtHand = 567000m, TotalDebt = 2345m, CreditScale = 0.02323d }; return(data); }