コード例 #1
0
 public void Configure(
     IInversionOfControlRegistration registration,
     IFakeGenerator fakeGenerator)
 {
     Configure(registration);
     Configure(fakeGenerator);
 }
コード例 #2
0
 public Autofaker(
     IInversionOfControlRegistration registration,
     IFakeGenerator fakeGenerator)
 {
     Configure(
         registration,
         fakeGenerator);
 }
コード例 #3
0
        /// <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]);
        }
コード例 #4
0
        public FakeStatusCyclocityRepository(
            ICyclocityRepository innerRepository,
            IFakeGenerator fakeStatusGenerator,
            ITaskulerScheduleHandle updateFakeDataScheduleHandle)
        {
            _InnerRepository = innerRepository;
            _FakeStatusGenerator = fakeStatusGenerator;
            _StationsListLock = new AsyncReaderWriterLock();

            updateFakeDataScheduleHandle.AddTask(async () => await _UpdateFakeDataAsync());
        }
コード例 #5
0
        public FakeStatusCyclocityRepository(
            ICyclocityRepository innerRepository,
            IFakeGenerator fakeStatusGenerator,
            ITaskulerScheduleHandle updateFakeDataScheduleHandle)
        {
            _InnerRepository     = innerRepository;
            _FakeStatusGenerator = fakeStatusGenerator;
            _StationsListLock    = new AsyncReaderWriterLock();

            updateFakeDataScheduleHandle.AddTask(async() => await _UpdateFakeDataAsync());
        }
コード例 #6
0
        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]);
        }
コード例 #7
0
 public void Configure(
     IFakeGenerator fakeGenerator)
 {
     _fakeGenerator = fakeGenerator;
 }