use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class XCardReaderTest method read_ignore_other_namespaces.
@Test
public void read_ignore_other_namespaces() throws Exception {
// @formatter:off
VCardAsserter asserter = readXml("<root>" + "<ignore xmlns=\"one\" />" + "<vcards xmlns=\"" + V4_0.getXmlNamespace() + "\">" + "<ignore xmlns=\"two\">text</ignore>" + "<vcard>" + "<fn>" + "<parameters>" + "<ignore xmlns=\"three\"><foo>bar</foo></ignore>" + "<pref><ignore xmlns=\"four\">bar</ignore><integer>1</integer></pref>" + "<pref><integer>2</integer></pref>" + "</parameters>" + "<text>Dr. Gregory House M.D.</text>" + "</fn>" + "</vcard>" + "</vcards>" + "</root>");
asserter.next(V4_0);
asserter.simpleProperty(FormattedName.class).value("Dr. Gregory House M.D.").param("PREF", "1").param("PREF", "2").noMore();
asserter.done();
// @formatter:on
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class XCardReaderTest method read_empty.
@Test
public void read_empty() throws Exception {
VCardAsserter asserter = readXml("<vcards xmlns=\"" + V4_0.getXmlNamespace() + "\" />");
asserter.done();
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class XCardReaderTest method read_xml_property.
@Test
public void read_xml_property() throws Exception {
// @formatter:off
VCardAsserter asserter = readXml("<vcards xmlns=\"" + V4_0.getXmlNamespace() + "\">" + "<vcard>" + "<x:foo xmlns:x=\"http://example.com\">" + "<parameters>" + "<pref><integer>1</integer></pref>" + "</parameters>" + "<!-- comment -->" + "<x:a />" + "<x:b attr=\"value\">text</x:b>" + "<x:c>text<x:child>child</x:child></x:c>" + "</x:foo>" + "</vcard>" + "</vcards>");
asserter.next(V4_0);
asserter.xml().param("PREF", "1").value("<foo xmlns=\"http://example.com\">" + "<a />" + "<b attr=\"value\">text</b>" + "<c>text<child>child</child></c>" + "</foo>").noMore();
asserter.done();
// @formatter:off
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class XCardReaderTest method read_single.
@Test
public void read_single() throws Exception {
// @formatter:off
VCardAsserter asserter = readXml("<!-- ignore -->" + "<vcards xmlns=\"" + V4_0.getXmlNamespace() + "\">" + "<vcard>" + "<fn><text>Dr. Gregory House M.D.</text></fn>" + "<n>" + "<surname>House</surname>" + "<given>Gregory</given>" + "<!-- ignore -->" + "<additional />" + "<prefix>Dr</prefix>" + "<prefix>Mr</prefix>" + "<suffix>MD</suffix>" + "</n>" + "</vcard>" + "</vcards>");
asserter.next(V4_0);
asserter.simpleProperty(FormattedName.class).value("Dr. Gregory House M.D.").noMore();
asserter.structuredName().family("House").given("Gregory").prefixes("Dr", "Mr").suffixes("MD").noMore();
asserter.done();
// @formatter:on
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class XCardReaderTest method read_wrong_namespace.
@Test
public void read_wrong_namespace() throws Exception {
// @formatter:off
VCardAsserter asserter = readXml("<vcards xmlns=\"wrong\">" + "<vcard>" + "<fn><text>Dr. Gregory House M.D.</text></fn>" + "</vcard>" + "</vcards>");
// @formatter:on
asserter.done();
}
Aggregations