use of ezvcard.io.json.JCardValue in project ez-vcard by mangstadt.
the class RawPropertyScribeTest method parseJson.
@Test
public void parseJson() {
JCardValue value = JCardValue.single("one\\,two");
sensei.assertParseJson(value).dataType(VCardDataType.TEXT).run(has("RAW", "one\\,two", VCardDataType.TEXT));
value = JCardValue.multi("one", "two,three");
sensei.assertParseJson(value).dataType(VCardDataType.TEXT).run(has("RAW", "one,two\\,three", VCardDataType.TEXT));
value = JCardValue.structured(Arrays.asList("one", "two"), Arrays.asList("three,four"));
sensei.assertParseJson(value).dataType(VCardDataType.TEXT).run(has("RAW", "one,two;three\\,four", VCardDataType.TEXT));
}
use of ezvcard.io.json.JCardValue in project ez-vcard by mangstadt.
the class VCardPropertyScribeTest method parseJson_single.
@Test
public void parseJson_single() {
final VCardParameters params = new VCardParameters();
JCardValue value = JCardValue.single("value");
sensei.assertParseJson(value).dataType(VCardDataType.TEXT).params(params).warnings((Integer) null).run(new Check<TestProperty>() {
public void check(TestProperty property) {
assertEquals("value", property.value);
assertSame(params, property.getParameters());
}
});
}
Aggregations