Added unit test cases for function.