I am getting this error when I am trying to include the Fragment class.
Bound mismatch: The type FirstFragment is not a valid substitute for the bounded parameter of the type ActivityInstrumentationTestCase2
MY code is as under :
package com.example.firstactivity.test;
import com.example.firstactivity.FirstFragment;
import android.test.ActivityInstrumentationTestCase2;
public class TestFirstFragment extends ActivityInstrumentationTestCase2<FirstFragment> {
private FirstFragment mFragment;
public TestFirstFragment(Class activityClass) {
super(activityClass);
// TODO Auto-generated constructor stub
}
@Override
protected void setUp() throws Exception {
super.setUp();
mFragment = getActivity();
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
public final void testPreconditions() {
assertNotNull(mFragment);
}
}
Please suggest a way to resolve this. When working with Activities it works fine... I have read some SO questions ex. FragmentActivity Junit Testing but either they did not answer my question or I could not follow them.