public FluencyConfiguration()
 {
     // Initialize default values.
     ConstructIdGenerator    = () => new StaticValueIdGenerator(0);
     DefaultValueConventions = new List <IDefaultConvention>
     {
         // Strings
         Convention.ByName("Firstname", p => ARandom.FirstName()),
         Convention.ByName("LastName", p => ARandom.LastName()),
         Convention.ByName("FullName", p => ARandom.FullName()),
         Convention.ByName("City", p => ARandom.City()),
         Convention.ByName("State", p => ARandom.StateCode()),
         Convention.ByName("Zip", p => ARandom.ZipCode()),
         Convention.ByName("ZipCode", p => ARandom.ZipCode()),
         Convention.ByName("PostalCode", p => ARandom.ZipCode()),
         Convention.ByName("Email", p => ARandom.Email()),
         Convention.ByName("Address", p => String.Format("{0} {1} {2}",
                                                         ARandom.IntBetween(10, 9999),
                                                         ARandom.LastName(),
                                                         ARandom.ItemFrom("Street", "Lane", "Ave.", "Blvd."))),
         Convention.ByName("Phone", p => ARandom.StringPattern("999-999-9999")),
         Convention.ByName("HomePhone", p => ARandom.StringPattern("999-999-9999")),
         Convention.ByName("WorkPhone", p => ARandom.StringPattern("999-999-9999")),
         Convention.ByName("BusinessPhone", p => ARandom.StringPattern("999-999-9999")),
         Convention.ByName("Fax", p => ARandom.StringPattern("999-999-9999")),
         Convention.String(20),
         // Dates
         Convention.ByName("BirthDate", p => ARandom.BirthDate()),
         Convention.DateType(),
         Convention.IntegerType(),
         Convention.ByType <Decimal>(p => ARandom.CurrencyAmount())
     };
 }
Esempio n. 2
0
 protected override void SetupDefaultValues()
 {
     // TODO: Setup AutoPopulation of random values by type. Need a way to override defaults.
     SetProperty(x => x.Id, GenerateNewId());
     SetProperty(x => x.UnitPrice, (double)ARandom.CurrencyAmount());
     SetProperty(x => x.Quantity, 1);
     SetProperty(x => x.Product, new ProductBuilder());
     SetProperty(x => x.Order, new OrderBuilder());
 }