Unit testing random number generator
Last year I wrote a chapter for OReillys book Beautiful Testing (ISBN ). The publisher gave each of us permission to post our chapters online, and so here is Chapter 10: How to test a random number generator.Threadsafe random number generator with unit testing support in C# In a current project I have to deal with lots of multithreaded random number generation. The first challenge that I came upon was that standard. NET Random implementation is not threadsafe. unit testing random number generator
So far I have put the call in a loop so it runs 1000 times and fails the test if the number is less than 0 the number is more than 10 How can I test that all the numbers aren't just the same, i. e.