use of ezvcard.property.SkipMeProperty in project ez-vcard by mangstadt.
the class XCardWriterTest method write_no_scribe_registered.
@Test
public void write_no_scribe_registered() throws Exception {
VCard vcard = new VCard();
vcard.setFormattedName("John Doe");
writer.write(vcard);
vcard = new VCard();
vcard.setFormattedName("Jane Doe");
vcard.addProperty(new SkipMeProperty());
try {
writer.write(vcard);
fail();
} catch (IllegalArgumentException e) {
// should be thrown
}
writer.close();
// the writer should check for scribes before writing anything to the stream
// @formatter:off
String expected = "<vcards xmlns=\"" + V4_0.getXmlNamespace() + "\">" + "<vcard>" + "<fn><text>John Doe</text></fn>" + "</vcard>" + "</vcards>";
// @formatter:on
assertOutput(expected);
}
Aggregations