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

Allow setting a custom Random #19

Closed
FrankHossfeld opened this issue Oct 8, 2022 · 1 comment
Closed

Allow setting a custom Random #19

FrankHossfeld opened this issue Oct 8, 2022 · 1 comment
Assignees

Comments

@FrankHossfeld
Copy link
Collaborator

FrankHossfeld commented Oct 8, 2022

Form arturmkrtchyan/iban4j#91

I'm using Kotest property based testing, and this needs a deterministic way of generating random data based on a seed, or existing Random instance.

iban4j can generate random IBANs, but I can't set a seed or pass in a Random instance.

I would like to add an overload for the 'Iban.random()method that will accept aRandom` parameter.

I can try making a PR for this, if you agree. Thanks!


Allow passing in a custom random, so users can make the generation deterministic.

resolves arturmkrtchyan/iban4j#91 based on arturmkrtchyan/iban4j#93

Summary

  • fix spelling mistake in test, ibanContruction -> ibanConstruction
  • add toString() to BbanStructureEntry.java (this helps the test error messages)
  • tests to check if randomness is deterministic
  • add additional tests for validity of BbanStructureEntry.java
@FrankHossfeld FrankHossfeld self-assigned this Oct 8, 2022
FrankHossfeld added a commit that referenced this issue Oct 11, 2022
* #19 - Allow setting a custom Random - initial commit

* #19 - Allow setting a custom Random - done (j2cl removed due to JUnit problems)
@FrankHossfeld
Copy link
Collaborator Author

Done

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

1 participant