Added test for random generator