Exemplo n.º 1
0
 public void test_dayOfWeekRule() throws Exception {
   DateTimeRule rule = CopticChronology.DAY_OF_WEEK;
   assertEquals(rule.getType(), DateTimeField.class);
   assertEquals(rule.getName(), "CopticDayOfWeek");
   assertEquals(rule.getValueRange(), DateTimeRuleRange.of(1, 7));
   assertEquals(rule.getPeriodUnit(), CopticChronology.DAYS);
   assertEquals(rule.getPeriodRange(), CopticChronology.WEEKS);
   serialize(rule);
 }
Exemplo n.º 2
0
 public void test_dayOfYearRule() throws Exception {
   DateTimeRule rule = CopticChronology.DAY_OF_YEAR;
   assertEquals(rule.getType(), DateTimeField.class);
   assertEquals(rule.getName(), "CopticDayOfYear");
   assertEquals(rule.getValueRange(), DateTimeRuleRange.of(1, 365, 366));
   assertEquals(rule.getPeriodUnit(), CopticChronology.DAYS);
   assertEquals(rule.getPeriodRange(), CopticChronology.YEARS);
   serialize(rule);
 }
Exemplo n.º 3
0
 public void test_monthOfYearRule() throws Exception {
   DateTimeRule rule = CopticChronology.MONTH_OF_YEAR;
   assertEquals(rule.getType(), DateTimeField.class);
   assertEquals(rule.getName(), "CopticMonthOfYear");
   assertEquals(rule.getValueRange(), DateTimeRuleRange.of(1, 13));
   assertEquals(rule.getPeriodUnit(), CopticChronology.MONTHS);
   assertEquals(rule.getPeriodRange(), CopticChronology.YEARS);
   serialize(rule);
 }
Exemplo n.º 4
0
 public void test_dayOfMonthRule() throws Exception {
   DateTimeRule rule = CopticChronology.DAY_OF_MONTH;
   assertEquals(rule.getType(), DateTimeField.class);
   assertEquals(rule.getName(), "CopticDayOfMonth");
   assertEquals(rule.getValueRange(), DateTimeRuleRange.of(1, 5, 30));
   assertEquals(rule.getPeriodUnit(), CopticChronology.DAYS);
   assertEquals(rule.getPeriodRange(), CopticChronology.MONTHS);
   serialize(rule);
 }
Exemplo n.º 5
0
 // -----------------------------------------------------------------------
 public void test_yearRule() throws Exception {
   DateTimeRule rule = CopticChronology.YEAR;
   assertEquals(rule.getType(), DateTimeField.class);
   assertEquals(rule.getName(), "CopticYear");
   assertEquals(
       rule.getValueRange(), DateTimeRuleRange.of(CopticDate.MIN_YEAR, CopticDate.MAX_YEAR));
   assertEquals(rule.getPeriodUnit(), CopticChronology.YEARS);
   assertEquals(rule.getPeriodRange(), null);
   serialize(rule);
 }