use of ezvcard.parameter.VCardParameters in project ez-vcard by mangstadt.
the class JCardRawReaderTest method different_data_types.
@Test
public void different_data_types() throws Throwable {
// @formatter:off
String json = "[\"vcard\"," + "[" + "[\"prop\", {}, \"text\", false, true, 1.1, 1, null, \"text\" ]" + "]" + "]";
// @formatter:on
JCardRawReader reader = createReader(json);
JCardDataStreamListener listener = mock(JCardDataStreamListener.class);
reader.readNext(listener);
verify(listener).beginVCard();
verify(listener).readProperty(null, "prop", new VCardParameters(), VCardDataType.TEXT, JCardValue.multi(false, true, 1.1, 1L, null, "text"));
verifyNoMoreInteractions(listener);
}
use of ezvcard.parameter.VCardParameters 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());
}
});
}
use of ezvcard.parameter.VCardParameters in project ez-vcard by mangstadt.
the class VCardPropertyScribeTest method parseText.
@Test
public void parseText() {
final VCardParameters params = new VCardParameters();
sensei.assertParseText("value").dataType(VCardDataType.TEXT).warnings((Integer) null).params(params).run(new Check<TestProperty>() {
public void check(TestProperty property) {
assertEquals("value", property.value);
assertEquals(VCardDataType.TEXT, property.parsedDataType);
assertSame(params, property.getParameters());
}
});
}
use of ezvcard.parameter.VCardParameters in project ez-vcard by mangstadt.
the class PidParameterListTest method invalid_value.
@Test
public void invalid_value() {
PidParameterListProperty property = new PidParameterListProperty();
VCardParameters parameters = property.getParameters();
List<Pid> pids = property.getPids();
parameters.put(VCardParameters.PID, "foobar");
try {
pids.get(0);
fail();
} catch (IllegalStateException e) {
assertTrue(e.getCause() instanceof NumberFormatException);
}
}
use of ezvcard.parameter.VCardParameters in project ez-vcard by mangstadt.
the class PropertyAsserter method reset.
private void reset() {
group = null;
parameters = new VCardParameters();
_reset();
}
Aggregations