public EmailAddressGenerator(IStringGenerator stringGenerator, ILastNameGenerator lastNameGenerator,
			ICompanyNameGenerator companyNameGenerator)
        {
            this.stringGenerator = stringGenerator;
            this.lastNameGenerator = lastNameGenerator;
            this.companyNameGenerator = companyNameGenerator;
        }
 public EmailAddressGenerator(IStringGenerator stringGenerator, ILastNameGenerator lastNameGenerator,
                              ICompanyNameGenerator companyNameGenerator)
 {
     this.stringGenerator      = stringGenerator;
     this.lastNameGenerator    = lastNameGenerator;
     this.companyNameGenerator = companyNameGenerator;
 }
 public UserQueryService(IUserRepository userRepository, IMapper mapper, IEncrypter encrypter, ITokenManager tokenManager, IStringGenerator stringGenerator)
 {
     this.userRepository  = userRepository;
     this.mapper          = mapper;
     this.encrypter       = encrypter;
     this.tokenManager    = tokenManager;
     this.stringGenerator = stringGenerator;
 }
示例#4
0
 public EmployeeGenerator(
     INumberGenerator numberGenerator,
     IStringGenerator stringGenerator,
     IRepository <Department> departmentsRepository)
 {
     this.numberGenerator       = numberGenerator;
     this.stringGenerator       = stringGenerator;
     this.departmentsRepository = departmentsRepository;
 }
 public CompanyObjectService(IAppRepository <CompanyApp> appRepository,
                             ICompanyRepository <Company> companyRepository,
                             IUserCompanyTemp userCompanyTemp,
                             IStringGenerator stringGenerator)
 {
     this.appRepository     = appRepository;
     this.companyRepository = companyRepository;
     this.userCompanyTemp   = userCompanyTemp;
     this.stringGenerator   = stringGenerator;
 }
        /// <summary>
        /// Adds the specified string generator along with its weight to the list.
        /// </summary>
        /// <param name="weight">The weight.</param>
        /// <param name="stringGenerator">The string generator.</param>
        public void Add(double weight, IStringGenerator stringGenerator)
        {
            ExceptionUtilities.CheckArgumentNotNull(stringGenerator, "stringGenerator");
            if (weight <= 0.0)
            {
                throw new TaupoArgumentException("Weight must be a positive number.");
            }

            this.generators.Add(stringGenerator);
            this.weights.Add(weight);
        }
        /// <summary>
        /// Adds the specified string generator along with its weight to the list.
        /// </summary>
        /// <param name="weight">The weight.</param>
        /// <param name="stringGenerator">The string generator.</param>
        public void Add(double weight, IStringGenerator stringGenerator)
        {
            ExceptionUtilities.CheckArgumentNotNull(stringGenerator, "stringGenerator");
            if (weight <= 0.0)
            {
                throw new TaupoArgumentException("Weight must be a positive number.");
            }

            this.generators.Add(stringGenerator);
            this.weights.Add(weight);
        }
示例#8
0
 public ProjectGenerator(
     INumberGenerator numberGenerator,
     IStringGenerator stringGenerator,
     IDateGenerator dateGenerator,
     IRepository <Employee> employeesRepository)
 {
     this.numberGenerator    = numberGenerator;
     this.stringGenerator    = stringGenerator;
     this.dateGenerator      = dateGenerator;
     this.employeeRepository = employeesRepository;
 }
示例#9
0
 public CompanySettingsService(ICompanyRepository <Company> companyRepository,
                               IAppDeletableEntityRepository <CompanyApp> companyAppRepository,
                               IStringGenerator stringGenerator,
                               IVatTypeService vatTypeService,
                               IProductService productService)
 {
     this.companyRepository    = companyRepository;
     this.companyAppRepository = companyAppRepository;
     this.stringGenerator      = stringGenerator;
     this.vatTypeService       = vatTypeService;
     this.productService       = productService;
 }
 public EmailConfirmation(UserManager <AppUser> userManager,
                          IRepository <Guid, ConfirmationToken> confirmationTokenRepo,
                          IRepository <string, AppUser> userRepo,
                          ILogger <EmailConfirmation> logger,
                          IStringGenerator stringGenerator
                          )
 {
     _userManager       = userManager;
     _userRepo          = userRepo;
     _logger            = logger;
     _stringGenerator   = stringGenerator;
     _confirmationToken = confirmationTokenRepo;
 }
示例#11
0
        private IDataGenerator ResolveStringGenerator(IRandomNumberGenerator random, DataGenerationHint[] hints, bool isNullable)
        {
            int minLength;
            int maxLength = this.GetMaxLengthAndCheckLengthRange(hints, out minLength);

            bool ansiString = hints.OfType <AnsiStringHint>().Any();

            IStringGenerator stringGenerator = ansiString ? this.AnsiStringGenerator : this.UnicodeStringGenerator;

            var stringPrefixHint = hints.OfType <StringPrefixHint>().SingleOrDefault();

            if (stringPrefixHint != null)
            {
                string prefix = stringPrefixHint.Value;
                ExceptionUtilities.Assert(prefix.Length < maxLength, "the length of string prefix in data generation exceeds the max length limit");
                return(CreateRandomGenerator <string>(random, (r) => prefix + stringGenerator.GenerateString(r, Math.Max(minLength - prefix.Length, 0), maxLength - prefix.Length), hints));
            }

            return(CreateRandomGenerator <string>(random, (r) => stringGenerator.GenerateString(r, minLength, maxLength), hints));
        }
 public ManagementController(
     IBroadcasterManager broadcasterManager,
     ICipherFactory cipherFactory,
     IConnectionManager connectionManager,
     IConsensusManager consensusManager,
     ILogger <ManagementController> logger,
     ISerializer serializer,
     ISmartContractTransactionService smartContractTransactionService,
     IStateRepositoryRoot stateRepositoryRoot,
     IStringGenerator stringGenerator,
     Network network)
 {
     _broadcasterManager = broadcasterManager;
     _cipherFactory      = cipherFactory;
     _connectionManager  = connectionManager;
     _consensusManager   = consensusManager;
     _logger             = logger;
     _serializer         = serializer;
     _smartContractTransactionService = smartContractTransactionService;
     _stateRepositoryRoot             = stateRepositoryRoot;
     _stringGenerator = stringGenerator;
     _network         = network;
 }
示例#13
0
 public SecondService(IStringGenerator stringGenerator)
 {
     _stringGenerator = stringGenerator;
 }
示例#14
0
 public CompanyService(IAppDeletableEntityRepository <CompanyApp> companyAppRepo, IStringGenerator connectionStringGenerator)
 {
     this.companyAppRepo  = companyAppRepo;
     this.stringGenerator = connectionStringGenerator;
 }
示例#15
0
 public void SetChangePasswordToken(IStringGenerator generator)
 => ChangePasswordToken = generator.Generate(50);
 /// <summary>
 /// Initializes a new instance of the SentenceStringGenerator class.
 /// </summary>
 /// <param name="wordGenerator">The word generator.</param>
 public SentenceStringGenerator(IStringGenerator wordGenerator)
 {
     ExceptionUtilities.CheckArgumentNotNull(wordGenerator, "wordGenerator");
     this.wordGenerator = wordGenerator;
 }
示例#17
0
 public ReducerController(IStringGenerator generator, IUriReducerRepository repository, IOptions <Settings> settings)
 {
     _keyGenerator     = generator;
     _repository       = repository;
     _currentKeyLength = settings.Value.KeyLettersCount;
 }
 public StringGenerationHandler(IGeneratorService generatorService, IStringGenerator stringGenerator)
 {
     this.generatorService = generatorService;
     this.stringGenerator  = stringGenerator;
 }
 public FirstService(IStringGenerator stringGenerator)
 {
     _stringGenerator = stringGenerator;
 }
 public CredentialLookup(IKeyVaultManager keyVaultManager, IStringGenerator stringGenerator)
 {
     this.keyVaultManager = keyVaultManager;
     this.stringGenerator = stringGenerator;
 }
示例#21
0
 public StringGeneratorTests()
 {
     strGen = new StringGenerator();
     //TDD approach
     //strGen = new MockStringGenerator();
 }
示例#22
0
 public UrlGenerator(IStringGenerator stringGenerator, ICompanyNameGenerator companyNameGenerator)
 {
     this.stringGenerator      = stringGenerator;
     this.companyNameGenerator = companyNameGenerator;
 }
示例#23
0
 public PersonController(IStringGenerator service)
 {
     this._service = service;
 }
示例#24
0
 public UrlGenerator(IStringGenerator stringGenerator, ICompanyNameGenerator companyNameGenerator)
 {
     this.stringGenerator = stringGenerator;
     this.companyNameGenerator = companyNameGenerator;
 }
示例#25
0
 /// <summary>
 /// Initializes a new instance of the SentenceStringGenerator class.
 /// </summary>
 /// <param name="wordGenerator">The word generator.</param>
 public SentenceStringGenerator(IStringGenerator wordGenerator)
 {
     ExceptionUtilities.CheckArgumentNotNull(wordGenerator, "wordGenerator");
     this.wordGenerator = wordGenerator;
 }
示例#26
0
 public Functions(IStringGenerator strGenerator)
 {
     // The Job Activator will inject the Concrete type (defined in the container) into this class
     _stringGenerator = strGenerator;
 }
示例#27
0
 public HumansController(APIBackend apiBackend, IStringGenerator stringGeneratorService, IModelFactory modelFactory)
 {
     _apiBackend             = apiBackend;
     _stringGeneratorService = stringGeneratorService;
     _modelFactory           = modelFactory;
 }
 public RandomController(IStringGenerator stringGenerator, IEnumerable <ISomeService> someServices)
 {
     _stringGenerator = stringGenerator;
     _someServices    = someServices;
 }
示例#29
0
 public DepartmentGenerator(IStringGenerator stringGenerator)
 {
     this.stringGenerator = stringGenerator;
 }
示例#30
0
        public async Task <IEnumerable <string> > GenerateSetOfStrings(string alphabet, int lenght, int count, IStringGenerator stringGenerator)
        {
            if (count <= 0)
            {
                throw new ArgumentException("Count can not be less or equal to 0!");
            }

            var tasks = new List <Task <string> >();

            for (int i = 0; i < count; i++)
            {
                tasks.Add(Task <string> .Run(() => stringGenerator.GenerateString(alphabet, lenght)));
            }

            var setOfStrings = await Task.WhenAll(tasks);

            return(setOfStrings);
        }