new unit test for random key generated