use of ezvcard.property.RawProperty in project ez-vcard by mangstadt.
the class VCardTest method getProperties.
@Test
public void getProperties() {
VCard vcard = new VCard();
assertCollectionContains(vcard.getProperties());
assertEquals(asList(), vcard.getProperties(Note.class));
assertEquals(asList(), vcard.getProperties(RawProperty.class));
Note property1 = new Note("value");
vcard.addProperty(property1);
assertCollectionContains(vcard.getProperties(), property1);
assertEquals(asList(property1), vcard.getProperties(Note.class));
assertEquals(asList(), vcard.getProperties(RawProperty.class));
RawProperty property2 = vcard.addExtendedProperty("X-GENDER", "male");
RawProperty property3 = vcard.addExtendedProperty("X-MANAGER", "Michael Scott");
assertCollectionContains(vcard.getProperties(), property1, property2, property3);
assertEquals(asList(property1), vcard.getProperties(Note.class));
assertEquals(asList(property2, property3), vcard.getProperties(RawProperty.class));
}
use of ezvcard.property.RawProperty in project ez-vcard by mangstadt.
the class VCardTest method removeExtendedProperty.
@Test
public void removeExtendedProperty() {
VCard vcard = new VCard();
assertEquals(asList(), vcard.removeExtendedProperty("NAME"));
assertEquals(asList(), vcard.getExtendedProperties());
RawProperty property = vcard.addExtendedProperty("NAME", "value");
RawProperty property2 = vcard.addExtendedProperty("NAME", "value2");
RawProperty property3 = vcard.addExtendedProperty("NAME2", "value");
assertEquals(asList(property, property2, property3), vcard.getExtendedProperties());
assertEquals(asList(property, property2), vcard.removeExtendedProperty("NAME"));
assertEquals(asList(property3), vcard.getExtendedProperties());
}
Aggregations