use of nl.knaw.huygens.timbuctoo.model.Datable in project timbuctoo by HuygensING.
the class DatableTest method convertYear.
@Test
public void convertYear() {
Assert.assertTrue(EdtfPattern.YEAR.matches("2010"));
Assert.assertFalse(EdtfPattern.YEAR.matches("201?"));
Assert.assertFalse(EdtfPattern.YEAR.matches("2010-02-13"));
testDatable("2010-01-01:12", "2010-12-31:12", Datable.Certainty.HIGH, new Datable("2010"));
}
use of nl.knaw.huygens.timbuctoo.model.Datable in project timbuctoo by HuygensING.
the class DatableTest method testYearConversion.
@Test
public void testYearConversion() throws ParseException {
Datable datable = new Datable("1709/1710");
Assert.assertEquals(1709, datable.getFromYear());
Assert.assertEquals(1710, datable.getToYear());
}
use of nl.knaw.huygens.timbuctoo.model.Datable in project timbuctoo by HuygensING.
the class DatableTest method convertMonth_year.
@Test
public void convertMonth_year() {
Assert.assertTrue(EdtfPattern.MONTH_YEAR_RX.matches("03-1854"));
Assert.assertTrue(EdtfPattern.MONTH_YEAR_RX.matches("3-1854"));
testDatable("1854-03-01:12", "1854-03-31:12", Datable.Certainty.MEDIUM, new Datable("03-1854"));
}
use of nl.knaw.huygens.timbuctoo.model.Datable in project timbuctoo by HuygensING.
the class DatableTest method testEqualsNotEqual.
@Test
public void testEqualsNotEqual() {
Datable first = new Datable("20131011");
Datable second = new Datable("20131012");
assertFalse(first.equals(second));
}
use of nl.knaw.huygens.timbuctoo.model.Datable in project timbuctoo by HuygensING.
the class DatableTest method convertYear_month_day.
@Test
public void convertYear_month_day() {
String edtf = "16480515";
Assert.assertTrue(EdtfPattern.YEAR_MONTH_DAY.matches(edtf));
testDatable("1648-05-15:12", "1648-05-15:12", Datable.Certainty.HIGH, new Datable(edtf));
}
Aggregations