user1730789
user1730789

Reputation: 5177

Android instrumentation testcases

In my instrumentation tests i have a function called

@SmallTest
    public void testPreconditions() {
        startActivity(mStartIntent, null, null);
        secondListView=(ListView)getActivity().findViewById(R.id.myListView);

    }

For JUnit to recognize a test case does the functionname have to start with testXXXX or can i follow any convention? Is this convention configurable anywhere ?

Kind Regards

Upvotes: 0

Views: 88

Answers (1)

Royston Pinto
Royston Pinto

Reputation: 6716

Yes, the function name has to start with test<function>. This is a standard convention followed to differentiate test units from other functions. Kindly follow the same to keep your code readable and understandable by others.

Upvotes: 1

Related Questions