use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class XCardReaderTest method read_parameters.
@Test
public void read_parameters() throws Exception {
// @formatter:off
VCardAsserter asserter = readXml("<vcards xmlns=\"" + V4_0.getXmlNamespace() + "\">" + "<vcard>" + // zero params
"<note>" + "<text>Note 1</text>" + "</note>" + // one param
"<note>" + "<parameters>" + "<altid><text>1</text></altid>" + "</parameters>" + "<text>Hello world!</text>" + "</note>" + // one param, but doesn't have a value element, so it should be ignored
"<note>" + "<parameters>" + "<altid>1</altid>" + "</parameters>" + "<text>Hallo Welt!</text>" + "</note>" + // two params
"<note>" + "<parameters>" + "<altid><text>1</text></altid>" + "<language><language-tag>fr</language-tag></language>" + "</parameters>" + "<text>Bonjour tout le monde!</text>" + "</note>" + // a param with multiple values
"<tel>" + "<parameters>" + "<type>" + "<text>work</text>" + "<text>voice</text>" + "</type>" + "</parameters>" + "<uri>tel:+1-555-555-1234</uri>" + "</tel>" + "</vcard>" + "</vcards>");
asserter.next(V4_0);
asserter.simpleProperty(Note.class).value("Note 1").next().value("Hello world!").param("ALTID", "1").next().value("Hallo Welt!").next().value("Bonjour tout le monde!").param("ALTID", "1").param("LANGUAGE", "fr").noMore();
asserter.telephone().uri(new TelUri.Builder("+1-555-555-1234").build()).types(TelephoneType.WORK, TelephoneType.VOICE).noMore();
asserter.done();
// @formatter:on
}
Aggregations