Ejemplo n.º 1
0
 public virtual void test_ofDayOfWeek_adjust()
 {
     foreach (DayOfWeek dow in DayOfWeek.values())
     {
         RollConvention test = RollConvention.ofDayOfWeek(dow);
         assertEquals(test.adjust(date(2014, AUGUST, 14)), date(2014, AUGUST, 14).with(TemporalAdjusters.nextOrSame(dow)));
     }
 }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "types") public void test_null(RollConvention type)
        public virtual void test_null(RollConvention type)
        {
            assertThrowsIllegalArg(() => type.adjust(null));
            assertThrowsIllegalArg(() => type.matches(null));
            assertThrowsIllegalArg(() => type.next(date(2014, JULY, 1), null));
            assertThrowsIllegalArg(() => type.next(null, P3M));
            assertThrowsIllegalArg(() => type.previous(date(2014, JULY, 1), null));
            assertThrowsIllegalArg(() => type.previous(null, P3M));
        }
Ejemplo n.º 3
0
 //-------------------------------------------------------------------------
 public virtual void test_ofDayOfMonth()
 {
     for (int i = 1; i < 30; i++)
     {
         RollConvention test = RollConvention.ofDayOfMonth(i);
         assertEquals(test.adjust(date(2014, JULY, 1)), date(2014, JULY, i));
         assertEquals(test.Name, "Day" + i);
         assertEquals(test.ToString(), "Day" + i);
         assertSame(RollConvention.of(test.Name), test);
         assertSame(RollConvention.of("DAY" + i), test);
     }
 }
Ejemplo n.º 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "adjust") public void test_adjust(RollConvention conv, java.time.LocalDate input, java.time.LocalDate expected)
        public virtual void test_adjust(RollConvention conv, LocalDate input, LocalDate expected)
        {
            assertEquals(conv.adjust(input), expected);
        }