@Test public void testErreurDateNull() { final DateMinMaxValidator test = new DateMinMaxValidator(Date.valueOf("2012-01-10"), Date.valueOf("2012-08-18")); test.check((String) null); assertFalse(test.hasError()); }
@Test public void testErreurDateSup() { final DateMinMaxValidator test = new DateMinMaxValidator(Date.valueOf("2012-01-10"), Date.valueOf("2012-08-18")); test.check("2013-11-01"); assertTrue(test.hasError()); }
@Test public void testErreurEgalInfErreur() { final DateMinMaxValidator test = new DateMinMaxValidator( Date.valueOf("2012-01-10"), false, Date.valueOf("2012-08-18"), true); test.check("2012-01-10"); assertTrue(test.hasError()); }
@Test public void testErreurVerif1() { final DateMinMaxValidator test = new DateMinMaxValidator( Date.valueOf("2012-07-18"), false, Date.valueOf("2012-08-18"), false); test.check("badSyntax"); assertTrue(test.hasError()); }