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)]; }
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(); } }
public abstract void RandomizeFields(ReferenceDataProvider referenceDataProvider);
public override void RandomizeFields(ReferenceDataProvider referenceDataProvider) { StringProperty = Randomizer.RandomString(10); }