title: How do you unit test code that relies on randomly generated numbers?
body: <p>What is the best way to unit test code that relies on you randomly generating data? I found <a href="https://stackoverflow.com/questions/10288096/how-to-write-unit-tests-for-functions-that-rely-on-dynamic-data">this</a> question on stack overflow but it is a little different. I know that you can use fixtures to mock out something like a database but I think that what I'm trying to do is a little different.</p>
  
  <p>I'm trying to write an <a href="http://en.wikipedia.org/wiki/ADALINE" rel="nofollow noreferrer">adaline neural network</a>. This requires me to randomly generate weights and then the values for the weights are adjusted as more data is presented to the network. How do I unit test something like this? I've started writing tests for the parts that don't rely on random inputs, but I don't know how to handle this part.</p>
  
  <p>Any suggestions would be appreciated.</p>