-
-
Notifications
You must be signed in to change notification settings - Fork 478
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
Define char quantity in random names #63
Comments
Hi @NicolaPicoli , Can you give me a few examples of what you're trying to do? Thanks, |
Hi @bchavez! Some entities have character size validations. For example, FirstName must be a minimum of 3 characters and a maximum of 30 characters. I would like when creating a random "FirstName" could include the minimum and maximum number of characters, for
Tks! |
Hi @NicolaPicoli , Thanks for your example. Could you try this:
Produces:
I think this is the best we can do. After considering your situation I don't think there's an easy way to do this inside Bogus where we avoid the random filler characters. The first problem arises where we don't have enough characters to meet the minimum length. What do we do?
If you have other ideas let me know but I don't think we should add this to Bogus since it's not an ideal solution. Some people might not be okay with the random filler characters. 💥 🔥 "Set it ablaze like a candle wick... Light it up, light it up..." |
Hi @NicolaPicoli , I've moved Thanks, 😎 ☁️ "I just wanna stay in the sun where I find... I know it's hard sometimes" |
Very Nice... Thanks @bchavez ! |
Nevertheless, I think having a max value would be useful. For example for testing layouts where we want to try different lengths. I would like to have this on full names. |
It would be very useful if we could insert a parameter to define a maximum and minimum quantity of characters in any object generated.
It would help many in running unit tests!
Thank you very much!
Nicola Picoli
The text was updated successfully, but these errors were encountered: