Xceptance / neodymium-library

A test automation library based on common other best practice open source libraries. It adds missing functionalities but does not reinvent the wheel. Just glues stuff together nicely and adds some sprinkles.
MIT License
80 stars 11 forks source link

Offer fixed random support #85

Closed rschwietzke closed 4 years ago

rschwietzke commented 5 years ago

It is often important to randomize things but still being able to replay the sequence later or fix up the randomness. Add support for that to Neo and ensure that order and behavior of test cases before does not influence the outcome.

occupant23 commented 4 years ago

implementation and documentation done, can be tested

oomelianchuk commented 4 years ago

IMO the changes are good, I have nothing to complain about, except for one typo

ckeiner commented 4 years ago
occupant23 commented 4 years ago

@ckeiner Can be rechecked.

Our implementation of nextInt(int n) returns 0 on n=0. The normal logic is to throw an Exception. Since our behaviour differs from the standard implementation, we should put this in the Javadoc of the method.

done

nextInt handles "0" specifically while getRandom(final int[]) throws an Exception when there is no data or an empty array. It feels inconsistent to throw an error here but not in the former method. Do note, that this is really not that bad and only feels a little weird.

won't fix. getRandom([0,0,0]) would work, but getRandom([]) doesn't give any hint which result set is expected

ckeiner commented 4 years ago

Alright.