use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method vcard_element_has_other_classes.
@Test
public void vcard_element_has_other_classes() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body>" + "<div class=\"foo bar vcard\">" + "<span class=\"fn\">John Doe</span>" + "</div>" + "</body>" + "</html>");
asserter.next(V3_0);
asserter.simpleProperty(FormattedName.class).value("John Doe").noMore();
asserter.done();
// @formatter:on
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method convert_instant_messenging_urls_to_impp_types.
@Test
public void convert_instant_messenging_urls_to_impp_types() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body>" + "<div class=\"vcard\">" + "<a class=\"url\" href=\"aim:goim?screenname=ShoppingBuddy\">IM with the AIM ShoppingBuddy</a>" + "</div>" + "</body>" + "</html>");
asserter.next(V3_0);
asserter.impp().uri("aim:ShoppingBuddy").noMore();
asserter.done();
// @formatter:on
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method property_tags_within_other_property_tags.
@Test
public void property_tags_within_other_property_tags() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body>" + "<div class=\"vcard\">" + "<div class=\"n\">" + "<span class=\"family-name org\">Smith</span>" + "</div>" + "</div>" + "</body>" + "</html>");
asserter.next(V3_0);
asserter.structuredName().family("Smith").noMore();
asserter.listProperty(Organization.class).values("Smith").noMore();
asserter.done();
// @formatter:on
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method property_tags_are_not_direct_children_of_root_tag.
@Test
public void property_tags_are_not_direct_children_of_root_tag() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body>" + "<div class=\"vcard\">" + "<h1>Welcome to my webpage</h1>" + "<table>" + "<tr>" + "<td>" + "<a class=\"fn url\" href=\"http://johndoe.com\">John Doe</span>" + "</td>" + "<td>" + "<span class=\"tel\">(555) 555-1234</span>" + "</td>" + "</tr>" + "</table>" + "</div>" + "</body>" + "</html>");
asserter.next(V3_0);
asserter.simpleProperty(FormattedName.class).value("John Doe").noMore();
asserter.simpleProperty(Url.class).value("http://johndoe.com").noMore();
asserter.telephone().text("(555) 555-1234").noMore();
asserter.done();
// @formatter:on
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class JCardReaderTest method read_single.
@Test
public void read_single() throws Throwable {
// @formatter:off
VCardAsserter asserter = readJson("[\"vcard\"," + "[" + "[\"version\", {}, \"text\", \"4.0\"]," + "[\"fn\", {}, \"text\", \"John Doe\"]" + "]" + "]");
asserter.next(V4_0);
asserter.simpleProperty(FormattedName.class).value("John Doe").noMore();
asserter.done();
// @formatter:on
}
Aggregations