Esempio n. 1
0
 // -----------------------------------------------------------------------
 @Test
 public void test_factory_int_singleton() {
   for (int i = 1; i <= MAX_LENGTH; i++) {
     Month test = Month.of(i);
     assertEquals(test.getValue(), i);
   }
 }
Esempio n. 2
0
 @Test(expectedExceptions = DateTimeException.class)
 public void test_factory_int_tooLow() {
   Month.of(0);
 }
Esempio n. 3
0
 // -----------------------------------------------------------------------
 // generated methods
 // -----------------------------------------------------------------------
 @Test
 public void test_enum() {
   assertEquals(Month.valueOf("JANUARY"), Month.JANUARY);
   assertEquals(Month.values()[0], Month.JANUARY);
 }
Esempio n. 4
0
 @Test(dataProvider = "minus")
 public void test_minus_long(int base, long amount, int expected) {
   assertEquals(Month.of(base).minus(amount), Month.of(expected));
 }
Esempio n. 5
0
 @Test(expectedExceptions = NullPointerException.class)
 public void test_factory_CalendricalObject_null() {
   Month.from((TemporalAccessor) null);
 }
Esempio n. 6
0
 @Test(expectedExceptions = DateTimeException.class)
 public void test_factory_CalendricalObject_invalid_noDerive() {
   Month.from(LocalTime.of(12, 30));
 }
Esempio n. 7
0
 // -----------------------------------------------------------------------
 @Test
 public void test_factory_CalendricalObject() {
   assertEquals(Month.from(LocalDate.of(2011, 6, 6)), JUNE);
 }