use of com.vodafone360.people.service.Authenticator in project 360-Engine-for-Android by 360.
the class AuthenticatorTest method testHasFeatures.
/***
* Test the hasFeatures() method.
*/
@SmallTest
public final void testHasFeatures() {
Authenticator authenticator = new Authenticator(getContext(), mApplication);
assertFalse("Expected hasFeatures() to return bundle boolean KEY_BOOLEAN_RESULT as FALSE", authenticator.hasFeatures(null, null, null).getBoolean(AccountManager.KEY_BOOLEAN_RESULT));
}
use of com.vodafone360.people.service.Authenticator in project 360-Engine-for-Android by 360.
the class AuthenticatorTest method testGetAuthToken.
/***
* Test the getAuthToken() method.
*/
@SmallTest
public final void testGetAuthToken() {
Authenticator authenticator = new Authenticator(getContext(), mApplication);
assertNull("Expected getAuthToken() to return NULL", authenticator.getAuthToken(null, null, null, null));
}
use of com.vodafone360.people.service.Authenticator in project 360-Engine-for-Android by 360.
the class AuthenticatorTest method testGetAuthTokenLabel.
/***
* Test the getAuthTokenLabel() method.
*/
@SmallTest
public final void testGetAuthTokenLabel() {
Authenticator authenticator = new Authenticator(getContext(), mApplication);
assertNull("Expected getAuthTokenLabel() to return NULL", authenticator.getAuthTokenLabel(null));
}
use of com.vodafone360.people.service.Authenticator in project 360-Engine-for-Android by 360.
the class AuthenticatorTest method testGetAccountRemovalAllowed.
/***
* Test the getAccountRemovalAllowed() method.
*/
@SmallTest
@Suppress
public final void testGetAccountRemovalAllowed() {
final TestStatus testStatus = new TestStatus();
Authenticator authenticator = new Authenticator(getContext(), new MainApplication() {
public void removeUserData() {
/*
* Test that the dummy mWakeListener.notifyOfWakeupAlarm() has
* been called, otherwise the test must fail.
*/
testStatus.setPass(true);
}
});
Bundle bundle = null;
try {
bundle = authenticator.getAccountRemovalAllowed(null, null);
} catch (NetworkErrorException e) {
fail("Unexpected NetworkErrorException");
}
/** Test if removeUserData() was called. **/
assertTrue("Expecting the removeUserData() dummy method to have " + "been called", testStatus.isPass());
assertEquals("Expected a KEY_BOOLEAN_RESULT boolean", true, bundle.getBoolean(AccountManager.KEY_BOOLEAN_RESULT));
}
use of com.vodafone360.people.service.Authenticator in project 360-Engine-for-Android by 360.
the class AuthenticatorTest method testEditProperties.
/***
* Test the editProperties() method.
*/
@SmallTest
public final void testEditProperties() {
Authenticator authenticator = new Authenticator(getContext(), mApplication);
try {
authenticator.editProperties(null, null);
fail("Expected editProperties() to throw an UnsupportedOperationException");
} catch (UnsupportedOperationException e) {
assertTrue("UnsupportedOperationException thrown as expected", true);
} catch (Exception e) {
fail("Expected editProperties() to throw an UnsupportedOperationException");
}
}
Aggregations