Esempio n. 1
0
  @Test
  public void returnsTheYearOfbeginDate() {

    assertEquals(Year.of(2015), timeInterval.getBeginYear());
  }
Esempio n. 2
0
 @Test
 public void testBetween_第一引数の時刻が第二引数の時刻より前なら受け付ける() {
   TimeInterval.between(LocalDateTime.MIN, LocalDateTime.MAX);
 }
Esempio n. 3
0
 /*
 ---
    ----
 */
 @Test
 public void testAbuts_false2() {
   TimeInterval arg = TimeInterval.between(baseEnd, baseEnd.plusMinutes(10));
   assertFalse(baseInterval.abuts(arg));
 }
Esempio n. 4
0
 /*
   -----
 -----
 */
 @Test
 public void testAbuts_true5() {
   assertTrue(baseInterval.abuts(createArg(-10, -10)));
 }
Esempio n. 5
0
 /*
 ---
     ----
 */
 @Test
 public void testAbuts_false1() {
   assertFalse(baseInterval.abuts(createArg(200, 200)));
 }
Esempio n. 6
0
 /*
 -----
 -----
 */
 @Test
 public void testAbuts_true1() {
   assertTrue(baseInterval.abuts(baseInterval));
 }
Esempio n. 7
0
 @Before
 public void setUp() {
   baseStart = LocalDateTime.of(2014, 12, 14, 7, 0);
   baseEnd = LocalDateTime.of(2014, 12, 14, 8, 30);
   baseInterval = TimeInterval.between(baseStart, baseEnd);
 }
Esempio n. 8
0
 @Test(expected = RuntimeException.class)
 public void testBetween_第一引数の時刻が第二引数の時刻より後なら例外を返す() {
   TimeInterval.between(LocalDateTime.MAX, LocalDateTime.MIN);
 }
Esempio n. 9
0
 // baseInterval始点と終点に、引数のminutes分それぞれ加算したインスタンスを返す
 private TimeInterval createArg(int start, int end) {
   return TimeInterval.between(baseStart.plusMinutes(start), baseEnd.plusMinutes(end));
 }
Esempio n. 10
0
 /*
     ---
 ----
 */
 @Test
 public void testAbuts_false4() {
   TimeInterval arg = TimeInterval.between(baseStart.plusMinutes(-10), baseStart);
   assertFalse(baseInterval.abuts(arg));
 }