@SmallTest public void testEmptyEmail() { try { emailAttribute.setValue(""); Assert.fail("Should have thrown InvalidAttributeValueException"); } catch (InvalidAttributeValueException e) { } }
@SmallTest public void testNullEmail() { try { emailAttribute.setValue(null); Assert.fail("Should have thrown InvalidAttributeValueException"); } catch (InvalidAttributeValueException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
@SmallTest public void testSetInvalidEmailValue() { String incorrectEmail = "rob@"; try { emailAttribute.setValue(incorrectEmail); Assert.fail("Should have thrown InvalidAttributeValueException"); } catch (InvalidAttributeValueException e) { } }
protected void setUp() throws Exception { mContext = getInstrumentation().getContext(); MIDaaS.setContext(mContext); // set the persistence delegate to a simple list. database doesn't seem to work after deletion. AttributePersistenceCoordinator.setPersistenceDelegate(new MockPersistence()); AuthenticationManager.getInstance() .setAccessTokenStrategy(new MockAccessTokenSuccessStrategy()); emailAttribute = EmailAttributeFactory.createAttribute(); emailAttribute.setValue(validEmail); mockFactory = new MockTransportFactory("init_email_ver_success.json"); mockFactory.setTrasport(new MockTransport(mContext)); ConnectionManager.setNetworkFactory(mockFactory); isInit = true; }