Пример #1
0
 @Test
 public void testDateMay31of2012IsValid() {
   assertTrue(dateValidator.isThisDateValid("31/05/2012", "dd/MM/yyyy"));
 }
Пример #2
0
 @Test
 public void testDateJanuary01of2012IsValid() {
   assertTrue(dateValidator.isThisDateValid("01/01/2012", "dd/MM/yyyy"));
 }
Пример #3
0
 @Test
 public void testDateApril30of2012IsValid() {
   assertTrue(dateValidator.isThisDateValid("30/04/2012", "dd/MM/yyyy"));
 }
Пример #4
0
 @Test
 public void testDateFeb29of2011() {
   assertFalse(dateValidator.isThisDateValid("29/02/2011", "dd/MM/yyyy"));
 }
Пример #5
0
 @Test
 public void testDateFeb28of2011() {
   assertTrue(dateValidator.isThisDateValid("28/02/2011", "dd/MM/yyyy"));
 }
Пример #6
0
 @Test
 public void testDateFeb29of2012() {
   assertTrue(dateValidator.isThisDateValid("29/02/2012", "dd/MM/yyyy"));
 }
Пример #7
0
 @Test
 public void testDateFormatIsInvalid() {
   assertFalse(dateValidator.isThisDateValid("2012/02/20", "dd/MM/yyyy"));
 }
Пример #8
0
 @Test
 public void testYearIsInvalid() {
   assertFalse(dateValidator.isThisDateValid("31/20/19991", "dd/MM/yyyy"));
 }
Пример #9
0
 @Test
 public void testMonthIsInvalid() {
   assertFalse(dateValidator.isThisDateValid("31/20/2012", "dd/MM/yyyy"));
 }
Пример #10
0
 @Test
 public void testDateIsNull() {
   assertFalse(dateValidator.isThisDateValid(null, "dd/MM/yyyy"));
 }