use of com.vodafone360.people.datatypes.VCardHelper.Name in project 360-Engine-for-Android by 360.
the class NowPlusDatatypesTests method testIdentity.
public void testIdentity() {
Identity input = new Identity();
input.mPluginId = "pluginid";
input.mNetwork = "network";
input.mIdentityId = "identityId";
input.mDisplayName = "displayname";
input.mCreated = new Long(12);
input.mUpdated = new Long(23);
input.mActive = true;
input.mAuthType = "none";
input.mIdentityType = "chat";
input.mUserId = new Integer(1234);
input.mUserName = "bob";
input.mCountryList = new ArrayList<String>();
input.mName = "bob";
String urlString = "http://www.mobica.com/";
try {
input.mNetworkUrl = new URL(urlString);
} catch (MalformedURLException e) {
input.mNetworkUrl = null;
}
assertFalse("Input identity Name or Network is Empty or NULL", input.isIdentityFieldBlankorNull());
Hashtable<String, Object> hash = new Hashtable<String, Object>();
hash.put("pluginid", input.mPluginId);
hash.put("network", input.mNetwork);
hash.put("identityid", input.mIdentityId);
hash.put("displayname", input.mDisplayName);
hash.put("networkurl", urlString);
hash.put("created", input.mCreated);
hash.put("updated", input.mUpdated);
hash.put("active", true);
hash.put("authtype", input.mAuthType);
hash.put("identitytype", input.mIdentityType);
hash.put("userid", new Long(1234));
hash.put("username", input.mUserName);
hash.put("countrylist", input.mCountryList);
hash.put("name", input.mName);
Identity helper = new Identity();
Identity output = helper.createFromHashtable(hash);
assertFalse("Output identity Name or Network is Empty or NULL", output.isIdentityFieldBlankorNull());
assertEquals(input.getType(), output.getType());
assertEquals(input.toString(), output.toString());
assertTrue(input.isSameAs(output));
}
Aggregations