Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Company Name doesn't work for AZ local #192

Closed
pabloalbrecht opened this issue Dec 10, 2018 · 1 comment
Closed

Company Name doesn't work for AZ local #192

pabloalbrecht opened this issue Dec 10, 2018 · 1 comment

Comments

@pabloalbrecht
Copy link

Try to generate a new Company Name using "az" as local and you will get an out of array range exception. if it doesn't happen first, try to generate 200 companies.
Works:

var FakeCompanies = new Faker<Company>().RuleFor(o => o.LegalName, f => f.Company.CompanyName());

Doesn't work:

var FakeCompanies = new Faker<Company>("az").RuleFor(o => o.LegalName, f => f.Company.CompanyName());
@bchavez
Copy link
Owner

bchavez commented Dec 10, 2018

Hi @pabloalbrecht ,

I think this is because the az locale doesn't have any company suffixes here.

So, here's how to resolve it.

  • Tell me some company suffixes for the az locale.
  • Or, submit a PR with company suffixes for the az locale in data_extend (do not change the automatically generated az.locale.json file directly, changes get over-written when we import from faker.js, so please add your locale extension of suffixes in data_extend).
  • Or, use the following as a work-around:
    var f = new Faker("az");
    var randomCompanyName = f.Company.CompanyName(f.Random.Number(1,2))
    

f.Company.CompanyName(0) is what actually causes the problem which requires a company suffix.

Thanks,
Brian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants