use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method mailto_url_with_email_and_url_class_names.
@Test
public void mailto_url_with_email_and_url_class_names() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body>" + "<div class=\"vcard\">" + "<a class=\"email url\" href=\"mailto:jdoe@hotmail.com\">Email me</a>" + "</div>" + "</body>" + "</html>");
asserter.next(V3_0);
asserter.simpleProperty(Url.class).value("mailto:jdoe@hotmail.com").noMore();
asserter.email().value("jdoe@hotmail.com").noMore();
asserter.done();
// @formatter:on
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method complete_vcard.
@Test
public void complete_vcard() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body>" + "<div class=\"vcard\">" + "<a class=\"fn org url\" href=\"http://www.commerce.net/\">CommerceNet</a>" + "<div class=\"adr\">" + "<span class=\"type\">Work</span>:" + "<div class=\"street-address\">169 University Avenue</div>" + "<span class=\"locality\">Palo Alto</span>, " + "<abbr class=\"region\" title=\"California\">CA</abbr> " + "<span class=\"postal-code\">94301</span>" + "<div class=\"country-name\">USA</div>" + "</div>" + "<div class=\"tel\">" + "<span class=\"type\">Work</span> +1-650-289-4040" + "</div>" + "<div class=\"tel\">" + "<span class=\"type\">Fax</span> +1-650-289-4041" + "</div>" + "<div>Email:" + "<span class=\"email\">info@commerce.net</span>" + "</div>" + "</div>" + "</body>" + "</html>");
asserter.next(V3_0);
asserter.simpleProperty(FormattedName.class).value("CommerceNet").noMore();
asserter.listProperty(Organization.class).values("CommerceNet").noMore();
asserter.simpleProperty(Url.class).value("http://www.commerce.net/").noMore();
asserter.address().types(AddressType.WORK).streetAddress("169 University Avenue").locality("Palo Alto").region("California").postalCode("94301").country("USA").noMore();
asserter.telephone().types(TelephoneType.WORK).text("+1-650-289-4040").next().types(TelephoneType.FAX).text("+1-650-289-4041").noMore();
asserter.email().value("info@commerce.net").noMore();
asserter.done();
// @formatter:on
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method empty_vcard.
@Test
public void empty_vcard() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body>" + "<div class=\"vcard\" />" + "</body>" + "</html>");
// @formatter:on
asserter.next(V3_0);
asserter.done();
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method convert_mailto_urls_to_email_types.
@Test
public void convert_mailto_urls_to_email_types() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body>" + "<div class=\"vcard\">" + "<a class=\"url\" href=\"mailto:jdoe@hotmail.com\">Email me</a>" + "</div>" + "</body>" + "</html>");
asserter.next(V3_0);
asserter.email().value("jdoe@hotmail.com").noMore();
asserter.done();
// @formatter:on
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method case_insensitive_property_names.
@Test
public void case_insensitive_property_names() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body>" + "<div class=\"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
}
Aggregations