Moved Test cases out of main function and as a separate test file