use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method add_all_nicknames_to_the_same_object.
@Test
public void add_all_nicknames_to_the_same_object() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body>" + "<div class=\"vcard\">" + "<span class=\"fn\">John Doe</span>" + "<span class=\"nickname\">Johnny</span>" + "<span class=\"nickname\">Johnny 5</span>" + "<span class=\"nickname\">Johnster</span>" + "</div>" + "</body>" + "</html>");
asserter.next(V3_0);
asserter.simpleProperty(FormattedName.class).value("John Doe").noMore();
asserter.listProperty(Nickname.class).values("Johnny", "Johnny 5", "Johnster").noMore();
asserter.done();
// @formatter:on
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method tel_url_with_tel_and_url_class_names.
@Test
public void tel_url_with_tel_and_url_class_names() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body>" + "<div class=\"vcard\">" + "<a class=\"tel url\" href=\"tel:+15555551234\">Call me</a>" + "</div>" + "</body>" + "</html>");
asserter.next(V3_0);
asserter.simpleProperty(Url.class).value("tel:+15555551234").noMore();
asserter.telephone().uri(new TelUri.Builder("+15555551234").build()).noMore();
asserter.done();
// @formatter:on
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method add_all_categories_to_the_same_object.
@Test
public void add_all_categories_to_the_same_object() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body>" + "<div class=\"vcard\">" + "<span class=\"fn\">John Doe</span>" + "<span class=\"category\">programmer</span>" + "<span class=\"category\">swimmer</span>" + "<span class=\"category\" rel=\"singer\">I also sing</span>" + "</div>" + "</body>" + "</html>");
asserter.next(V3_0);
asserter.simpleProperty(FormattedName.class).value("John Doe").noMore();
asserter.listProperty(Categories.class).values("programmer", "swimmer", "singer").noMore();
asserter.done();
// @formatter:on
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method single_tag_with_multiple_properties.
@Test
public void single_tag_with_multiple_properties() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body>" + "<div class=\"vcard\">" + "<a class=\"fn url\" href=\"http://johndoe.com\">John Doe</span>" + "</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.done();
// @formatter:on
}
use of ezvcard.property.asserter.VCardAsserter in project ez-vcard by mangstadt.
the class HCardParserTest method html_without_vcard.
@Test
public void html_without_vcard() throws Exception {
// @formatter:off
VCardAsserter asserter = readHtml("<html>" + "<body></body>" + "</html>");
// @formatter:on
asserter.done();
}
Aggregations