Re: Testing a class which utilizes randomness

<[email protected]> 04 Apr 2014 15:51:22 -0700
Newsgroups gmane.comp.programming.test-driven-development
Message-ID <[email protected]>
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