Skip to content

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

@serhalp

Description

@serhalp

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions