コード例 #1
0
 public override void RandomizeFields(ReferenceDataProvider referenceDataProvider)
 {
     StringProperty    = Randomizer.RandomString(10);
     EnumProperty      = Randomizer.RandomEnum <MyEnum>();
     IntegerProperty   = Randomizer.RandomInteger(10);
     ReferenceProperty = referenceDataProvider.MyReferenceObjects[Randomizer.RandomInteger(referenceDataProvider.MyReferenceObjects.Count - 1)];
 }
コード例 #2
0
 public void InsertRecords <T>(int count) where T : MyObjectBase
 {
     using (UnitOfWork uow = new UnitOfWork(DefaultDataLayer))
     {
         ReferenceDataProvider referenceDataProvider = new ReferenceDataProvider(uow);
         for (int i = 0; i < count; i++)
         {
             T myObject = (T)Activator.CreateInstance(typeof(T), new object[1] {
                 uow
             });
             myObject.RandomizeFields(referenceDataProvider);
             myObject.Save();
         }
         uow.CommitChanges();
     }
 }
コード例 #3
0
 public abstract void RandomizeFields(ReferenceDataProvider referenceDataProvider);
コード例 #4
0
 public override void RandomizeFields(ReferenceDataProvider referenceDataProvider)
 {
     StringProperty = Randomizer.RandomString(10);
 }