defined methods and test cases for train class. class not yet completed