¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Testing a class which utilizes randomness


 

Hello!

Thanks everyone for your replies. Like I said, I'm not testing the RNG (or RSG in this case), but rather the algorithm which deals with duplicates.
I'll go with what David and John suggested, writing a class to generate unique random strings and injecting a random string generator.
Interesting how a TDD approach resulted in code being organized properly. If I hadn't used it, I'd probably have written a method that used an embedded random string generator and would never have given the problem a second thought.

Thanks for the help,
Nikola