Search in sources :

Example 11 with VCardAsserter

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
}
Also used : VCardAsserter(ezvcard.property.asserter.VCardAsserter) Test(org.junit.Test)

Example 12 with VCardAsserter

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
}
Also used : TelUri(ezvcard.util.TelUri) VCardAsserter(ezvcard.property.asserter.VCardAsserter) Test(org.junit.Test)

Example 13 with VCardAsserter

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
}
Also used : VCardAsserter(ezvcard.property.asserter.VCardAsserter) Test(org.junit.Test)

Example 14 with VCardAsserter

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
}
Also used : VCardAsserter(ezvcard.property.asserter.VCardAsserter) Test(org.junit.Test)

Example 15 with VCardAsserter

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();
}
Also used : VCardAsserter(ezvcard.property.asserter.VCardAsserter) Test(org.junit.Test)

Aggregations

VCardAsserter (ezvcard.property.asserter.VCardAsserter)86 Test (org.junit.Test)84 Url (ezvcard.property.Url)12 VCard (ezvcard.VCard)10 VCardVersion (ezvcard.VCardVersion)10 FreeBusyUrl (ezvcard.property.FreeBusyUrl)9 Note (ezvcard.property.Note)7 Organization (ezvcard.property.Organization)7 Photo (ezvcard.property.Photo)7 FormattedName (ezvcard.property.FormattedName)6 Key (ezvcard.property.Key)6 UtcOffset (ezvcard.util.UtcOffset)5 CannotParseScribe (ezvcard.io.scribe.CannotParseScribe)4 SkipMeScribe (ezvcard.io.scribe.SkipMeScribe)4 TelUri (ezvcard.util.TelUri)4 Label (ezvcard.property.Label)3 StreamReader (ezvcard.io.StreamReader)2 Categories (ezvcard.property.Categories)2 Utf8Writer (ezvcard.util.Utf8Writer)2 File (java.io.File)2