.net - How to test for sometimes fails? -


I am trying to write a unit test for a module which will give me a random list of numbers according to certain criteria. / P>

The particular test that I am writing is a modification of the original order. I am testing it.

  • The sequence is the same length
  • The sequence The same values ​​are
  • The sequence is not in the same order

The problem with this is that sometimes in the order are in the same order What would be the best way to deal with this?

I am using NUnit (but it can use another test framework if it helps).

How are you generating your random numbers?

I will start by controlling the seeds of your random number generator, and redefining your third exam "Scenes are not in the same order when we use a different seed".


Comments