use of nl.knaw.huygens.timbuctoo.core.dto.property.DatableProperty in project timbuctoo by HuygensING.
the class JsonPropertyConverterTest method toReturnsAJsonEncodedStringForADatableProperty.
@Test
public void toReturnsAJsonEncodedStringForADatableProperty() throws Exception {
JsonPropertyConverter instance = new JsonPropertyConverter(null);
DatableProperty property = new DatableProperty("prop", "1800");
Tuple<String, JsonNode> value = instance.to(property);
assertThat(value.getRight(), is(jsn("1800")));
}
use of nl.knaw.huygens.timbuctoo.core.dto.property.DatableProperty in project timbuctoo by HuygensING.
the class TinkerPopPropertyConverterTest method toReturnsAJsonEncodedStringForADatableProperty.
@Test
public void toReturnsAJsonEncodedStringForADatableProperty() throws Exception {
TinkerPopPropertyConverter instance = new TinkerPopPropertyConverter(null);
DatableProperty property = new DatableProperty(PROPERTY_NAME, "1800");
Tuple<String, Object> value = instance.to(property);
assertThat(value.getRight(), is("\"1800\""));
}
use of nl.knaw.huygens.timbuctoo.core.dto.property.DatableProperty in project timbuctoo by HuygensING.
the class JsonPropertyConverterTest method toConvertsADatablePropertyToAString.
@Test
public void toConvertsADatablePropertyToAString() throws Exception {
JsonPropertyConverter instance = new JsonPropertyConverter(null);
DatableProperty datableProperty = new DatableProperty("", "2016-01-02");
Tuple<String, JsonNode> value = instance.to(datableProperty);
assertThat(value.getRight(), is(jsn("2016-01-02")));
}
use of nl.knaw.huygens.timbuctoo.core.dto.property.DatableProperty in project timbuctoo by HuygensING.
the class TinkerPopPropertyConverterTest method toThrowsAnExceptionWhenTheDateFormatIsNotSupported.
@Test(expected = IOException.class)
public void toThrowsAnExceptionWhenTheDateFormatIsNotSupported() throws Exception {
TinkerPopPropertyConverter instance = new TinkerPopPropertyConverter(null);
DatableProperty property = new DatableProperty(PROPERTY_NAME, "01-02-180");
instance.to(property);
}
Aggregations