test get code method