public void Configure( IInversionOfControlRegistration registration, IFakeGenerator fakeGenerator) { Configure(registration); Configure(fakeGenerator); }
public Autofaker( IInversionOfControlRegistration registration, IFakeGenerator fakeGenerator) { Configure( registration, fakeGenerator); }
/// <summary> /// Adds a custom fake data generator /// </summary> /// <param name="customType">Custom generator instance</param> /// <param name="name">Unique name</param> /// <returns></returns> public IFakeGenerator AddGenerator(IFakeGenerator customType, string name) { if (generators.ContainsKey(name)) { throw new DotNetFakerException(string.Format("Duplicate generator named {0}", name)); } customType.Random = random; generators.Add(name, customType); return(generators[name]); }
public FakeStatusCyclocityRepository( ICyclocityRepository innerRepository, IFakeGenerator fakeStatusGenerator, ITaskulerScheduleHandle updateFakeDataScheduleHandle) { _InnerRepository = innerRepository; _FakeStatusGenerator = fakeStatusGenerator; _StationsListLock = new AsyncReaderWriterLock(); updateFakeDataScheduleHandle.AddTask(async () => await _UpdateFakeDataAsync()); }
public FakeStatusCyclocityRepository( ICyclocityRepository innerRepository, IFakeGenerator fakeStatusGenerator, ITaskulerScheduleHandle updateFakeDataScheduleHandle) { _InnerRepository = innerRepository; _FakeStatusGenerator = fakeStatusGenerator; _StationsListLock = new AsyncReaderWriterLock(); updateFakeDataScheduleHandle.AddTask(async() => await _UpdateFakeDataAsync()); }
private IFakeGenerator getGenerator(GeneratorType type) { string typeString = type.ToString(); if (generators.ContainsKey(typeString)) { return(generators[typeString]); } Type systemType = Type.GetType(String.Format("{0}.{1}{2}", "DotNetFaker.Generators", typeString, "Generator")); IFakeGenerator generator = (IFakeGenerator)Activator.CreateInstance(systemType); generator.Random = random; generators.Add(typeString, generator); return(generators[typeString]); }
public void Configure( IFakeGenerator fakeGenerator) { _fakeGenerator = fakeGenerator; }