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

Collections are always generated with the same size #387 #391

Closed

Conversation

mjureczko
Copy link
Contributor

#387

The solution is based on reusing the same instance of IntegerRangeRandomizer for generating collections size. Originally, a new instance of IntegerRangeRandomizer was created whenever a collection was populated, each time with the same seed value. As a consequence IntegerRangeRandomizer always generated the same value.

Presumably, the same solution should be applied to arrays.

@fmbenhassine
Copy link
Member

@mjureczko Thank you for this PR. However, I see no need to pass the parameters to the collection populator (those can be retrieved from the context which is available in the scope) and to extract the integerRangeRandomizer as a field. This requires to change signature of the constructor with all required changes in tests. I also did not understand why you completely removed the generatedObjectShouldBeAlwaysTheSameForTheSameSeed test instead of adapting it.

Using a random seed in the collection populator is enough to fix the issue (as shown in 71aa680).

Thank you for raising the issue and for your PR anyway!

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

Successfully merging this pull request may close these issues.

Collections are always generated with the same size
2 participants