forked from fanruan/design
lucian
3 years ago
2 changed files with 28 additions and 2 deletions
@ -0,0 +1,27 @@
|
||||
package com.fr.design.widget.ui.designer.date.check; |
||||
|
||||
import org.junit.Assert; |
||||
import org.junit.Test; |
||||
|
||||
/** |
||||
* @author Lucian.Chen |
||||
* @version 10.0 |
||||
* Created by Lucian.Chen on 2022/4/18 |
||||
*/ |
||||
public class DateFormatFrontCheckTest { |
||||
|
||||
@Test |
||||
public void testAccept() { |
||||
Assert.assertTrue(DateFormatFrontCheck.KEY.accept("20220101", "yyyyMMdd")); |
||||
Assert.assertTrue(DateFormatFrontCheck.KEY.accept("202201", "yyyyMM")); |
||||
Assert.assertTrue(DateFormatFrontCheck.KEY.accept("2022-01-01", "yyyy-MM-dd")); |
||||
Assert.assertTrue(DateFormatFrontCheck.KEY.accept("22/01/01", "yy/MM/dd")); |
||||
Assert.assertTrue(DateFormatFrontCheck.KEY.accept("2022年01月01日", "yyyy年MM月dd日")); |
||||
Assert.assertTrue(DateFormatFrontCheck.KEY.accept("2022/01/01 12:30:00", "yyyy/MM/dd HH:mm:ss")); |
||||
|
||||
Assert.assertFalse(DateFormatFrontCheck.KEY.accept("220101", "yyMMdd")); |
||||
Assert.assertFalse(DateFormatFrontCheck.KEY.accept("20221", "yyyyM")); |
||||
Assert.assertFalse(DateFormatFrontCheck.KEY.accept("20220101123000", "yyyyMMddHHmmss")); |
||||
Assert.assertFalse(DateFormatFrontCheck.KEY.accept("2022-01-01", "YYYY-MM-dd")); |
||||
} |
||||
} |
Loading…
Reference in new issue