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

Add fake.smallNonNegativeInteger() (and fake.smallPositiveInteger()?) #74

Open
serhalp opened this issue Jan 11, 2021 · 0 comments
Open

Comments

@serhalp
Copy link
Contributor

serhalp commented Jan 11, 2021

For cases where we wish to express that some data should be a non-negative integer, but the specific range does not matter.

The method should take in the same arguments as fake.integer() (min and max), but default to 1 and something like 20, respectively.

@mattpetrie and I don't believe there's much of a use case for any of these other variations:

  • small negative integer
  • small integer, allowed to be negative or positive

However, both the "small >0 int" (fake.smallPositiveInteger()) and "small >= 0 int" (fake.smallNonNegativeInteger()) cases seem common enough. Should we add both these methods? Is there a way to make this a single method with a param?

Is "small" a good descriptor?

The name is a bit long, but since we have fake.integer(), I don't think we should abbreviate to "int", for consistency.

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

No branches or pull requests

1 participant