Example #1
0
 public virtual void test_ofDayOfWeek_previous_oneDay()
 {
     foreach (DayOfWeek dow in DayOfWeek.values())
     {
         RollConvention test = RollConvention.ofDayOfWeek(dow);
         assertEquals(test.previous(date(2014, AUGUST, 14), P1D), date(2014, AUGUST, 13).with(TemporalAdjusters.previousOrSame(dow)));
     }
 }
Example #2
0
 public virtual void test_ofDayOfWeek_next_oneMonth()
 {
     foreach (DayOfWeek dow in DayOfWeek.values())
     {
         RollConvention test = RollConvention.ofDayOfWeek(dow);
         assertEquals(test.next(date(2014, AUGUST, 14), P1W), date(2014, AUGUST, 21).with(TemporalAdjusters.nextOrSame(dow)));
     }
 }
Example #3
0
 //-------------------------------------------------------------------------
 public virtual void test_ofDayOfWeek()
 {
     foreach (DayOfWeek dow in DayOfWeek.values())
     {
         RollConvention test = RollConvention.ofDayOfWeek(dow);
         assertEquals(test.Name, "Day" + CaseFormat.UPPER_UNDERSCORE.converterTo(CaseFormat.UPPER_CAMEL).convert(dow.ToString()).substring(0, 3));
         assertEquals(test.ToString(), "Day" + CaseFormat.UPPER_UNDERSCORE.converterTo(CaseFormat.UPPER_CAMEL).convert(dow.ToString()).substring(0, 3));
         assertSame(RollConvention.of(test.Name), test);
         assertSame(RollConvention.of("DAY" + dow.ToString().Substring(0, 3)), test);
     }
 }
Example #4
0
 public virtual void test_ofDayOfWeek_matches()
 {
     assertEquals(RollConvention.ofDayOfWeek(TUESDAY).matches(date(2014, SEPTEMBER, 1)), false);
     assertEquals(RollConvention.ofDayOfWeek(TUESDAY).matches(date(2014, SEPTEMBER, 2)), true);
     assertEquals(RollConvention.ofDayOfWeek(TUESDAY).matches(date(2014, SEPTEMBER, 3)), false);
 }