Я следую этому уроку https://www.youtube.com/watch?v=_TR6QcRozAg для моего первого модульного тестирования активности Android, но получаю некоторую ошибку в коде, где "ActivityTestRule" и "getClass ()" показывают красный цвет. Не удается выполнить код
package e.asus.supershop;
import android.view.View;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import static org.junit.Assert.*;
public class LoginActivityTest {
@Rule
public ActivityTestRule<LoginActivity> mActivityTestRule = new ActivityTestRule<LoginActivity>(LoginActivity.class);
private LoginActivity mActivity = null;
@Before
public void setUp() throws Exception {
mActivity = mActivityTestRule.getClass();
}
@Test
public void testLaunch()
{
View view = mActivity.findViewById(R.id.buttonSignin);
assertNotNull(view);
}
@After
public void tearDown() throws Exception {
mActivity = null;
}
}