예제 #1
0
  @Test
  public void returnsTheYearOfbeginDate() {

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