You can use a mocking structure to mock your random number generator. This way you remove randomness from your result and you can test your code with a static set of predefined test cases.
In all cases, you are not testing the generation of random numbers, but the calculations you do. And if you have an error, you really need to know the random numbers used to reproduce the error.
Peter source share