I have a function which takes in two parameters, and returns one or the other 50% of the time.
The unit test for this should determine that both parameters could be
You can do one of two things:
Option #1 is nearly always preferred. By including your random number generator you're no longer testing an atomic unit of code, and by including a stochastic component into unit testing, you need to do statistics to verify that the code is working correctly. There are some bugs that option #2 can never pick up in a reasonable number of tests, which is worrying.