Exemplo n.º 1
0
  public void testWeekday2() {
    // 2008/4/24 falls on a Thursday.

    // If Sunday is the first day of the week, Thursday is day 5.
    assertEquals(5, Vba.weekday(SAMPLE_DATE, Calendar.SUNDAY));

    // If Monday is the first day of the week, then 2008/4/24 falls on the
    // 4th day of the week
    assertEquals(4, Vba.weekday(SAMPLE_DATE, Calendar.MONDAY));

    assertEquals(3, Vba.weekday(SAMPLE_DATE, Calendar.TUESDAY));
    assertEquals(2, Vba.weekday(SAMPLE_DATE, Calendar.WEDNESDAY));
    assertEquals(1, Vba.weekday(SAMPLE_DATE, Calendar.THURSDAY));
    assertEquals(7, Vba.weekday(SAMPLE_DATE, Calendar.FRIDAY));
    assertEquals(6, Vba.weekday(SAMPLE_DATE, Calendar.SATURDAY));
  }
Exemplo n.º 2
0
 public void testWeekday1() {
   if (Calendar.getInstance().getFirstDayOfWeek() == Calendar.SUNDAY) {
     assertEquals(Calendar.THURSDAY, Vba.weekday(SAMPLE_DATE));
   }
 }