Methods Summary |
---|
private void | getActivityAndFields()Get the activity (which causes it to be started, using our intent) and get the UI fields
mActivity = getActivity();
mDoneButton = (Button) mActivity.findViewById(R.id.done);
|
private android.content.Intent | getTestIntent(java.lang.String name)Create an intent with the Account in it
Account account = new Account(this.getInstrumentation().getTargetContext());
account.setName(name);
Intent i = new Intent(Intent.ACTION_MAIN);
i.putExtra("account", account); // AccountSetupNames.EXTRA_ACCOUNT == "account"
return i;
|
public void | testBadAccountName()Test a "bad" account name (disables the button)
Intent i = getTestIntent("");
this.setActivityIntent(i);
getActivityAndFields();
assertFalse(mDoneButton.isEnabled());
|
public void | testGoodAccountName()Test a "good" account name (enables the button)
Intent i = getTestIntent("GoodName");
this.setActivityIntent(i);
getActivityAndFields();
assertTrue(mDoneButton.isEnabled());
|