package Ġro . dob re sc u and rei . timeline view v 2 Ċ Ċ import Ġorg . joda . time . DateTime Ċ import Ġorg . joda . time . format . DateTime Format Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġro . dob re sc u and rei . timeline view v 2 . model . Daily DateTime Interval Ċ import Ġro . dob re sc u and rei . timeline view v 2 . model . DateTime Interval Ċ import Ġro . dob re sc u and rei . timeline view v 2 . model . Year ly DateTime Interval Ċ Ċ class ĠYear ly DateTime Interval Test Ċ { ĊĠĠĠ Ġprivate Ġval ĠdateTime Interval Ġ: ĠDateTime Interval Ġ= ĠYear ly DateTime Interval ( ĊĠĠĠĠĠĠĠ Ġreference DateTime Ġ= ĠDateTime ( 2 0 2 1 , Ġ 1 , Ġ 1 2 , Ġ 0 , Ġ 0 , Ġ 0 , Ġ 0 )) ĊĊĠĠĠ Ġprivate Ġval ĠdateTime Formatter Ġ= ĠDateTime Format . for Pattern (" dd . MM . yyyy ĠHH : mm : ss . SS S ") ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġsetup () Ġ= Ġsetup UnitTests () ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Interval Range () ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ ĠassertEquals (" 0 1 . 0 1 . 2 0 2 1 Ġ 0 0 : 0 0 : 0 0 . 0 0 0 ", ĠdateTime Formatter . print ( dateTime Interval . from DateTime )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 3 1 . 1 2 . 2 0 2 1 Ġ 2 3 : 5 9 : 5 9 . 9 9 9 ", ĠdateTime Formatter . print ( dateTime Interval . to DateTime )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Interval Sh ifting () ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ ĠassertEquals (" 2 0 2 1 ", ĠdateTime Interval . toString ( mock Resources )) ĊĊĠĠĠĠĠĠĠ Ġval Ġ_ 2 0 2 2 = dateTime Interval . getNext DateTime Interval () !! ĊĠĠĠĠĠĠĠ ĠassertEquals (" 0 1 . 0 1 . 2 0 2 2 Ġ 0 0 : 0 0 : 0 0 . 0 0 0 ", ĠdateTime Formatter . print (_ 2 0 2 2 . from DateTime )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 3 1 . 1 2 . 2 0 2 2 Ġ 2 3 : 5 9 : 5 9 . 9 9 9 ", ĠdateTime Formatter . print (_ 2 0 2 2 . to DateTime )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 2 0 2 2 ", Ġ_ 2 0 2 2 . toString ( mock Resources )) ĊĊĠĠĠĠĠĠĠ Ġval Ġ_ 2 0 2 3 = dateTime Interval . get Shift ed DateTime Interval ( 2 ) !! ĊĠĠĠĠĠĠĠ ĠassertEquals (" 0 1 . 0 1 . 2 0 2 3 Ġ 0 0 : 0 0 : 0 0 . 0 0 0 ", ĠdateTime Formatter . print (_ 2 0 2 3 . from DateTime )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 3 1 . 1 2 . 2 0 2 3 Ġ 2 3 : 5 9 : 5 9 . 9 9 9 ", ĠdateTime Formatter . print (_ 2 0 2 3 . to DateTime )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 2 0 2 3 ", Ġ_ 2 0 2 3 . toString ( mock Resources )) ĊĊĠĠĠĠĠĠĠ Ġval Ġ_ 2 0 2 0 = dateTime Interval . get Previous DateTime Interval () !! ĊĠĠĠĠĠĠĠ ĠassertEquals (" 0 1 . 0 1 . 2 0 2 0 Ġ 0 0 : 0 0 : 0 0 . 0 0 0 ", ĠdateTime Formatter . print (_ 2 0 2 0 . from DateTime )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 3 1 . 1 2 . 2 0 2 0 Ġ 2 3 : 5 9 : 5 9 . 9 9 9 ", ĠdateTime Formatter . print (_ 2 0 2 0 . to DateTime )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 2 0 2 0 ", Ġ_ 2 0 2 0 . toString ( mock Resources )) ĊĊĠĠĠĠĠĠĠ Ġval Ġ_ 2 0 1 9 = dateTime Interval . get Shift ed DateTime Interval (- 2 ) !! ĊĠĠĠĠĠĠĠ ĠassertEquals (" 0 1 . 0 1 . 2 0 1 9 Ġ 0 0 : 0 0 : 0 0 . 0 0 0 ", ĠdateTime Formatter . print (_ 2 0 1 9 . from DateTime )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 3 1 . 1 2 . 2 0 1 9 Ġ 2 3 : 5 9 : 5 9 . 9 9 9 ", ĠdateTime Formatter . print (_ 2 0 1 9 . to DateTime )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 2 0 1 9 ", Ġ_ 2 0 1 9 . toString ( mock Resources )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Interval Around Today () ĊĠĠĠ Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġyear = Daily DateTime Interval . today (). from DateTime . year ĊĠĠĠĠĠĠĠ Ġval Ġinterval = Year ly DateTime Interval . around Today () ĊĠĠĠĠĠĠĠ ĠassertEquals (" 0 1 . 0 1 .$ year Ġ 0 0 : 0 0 : 0 0 . 0 0 0 ", ĠdateTime Formatter . print ( interval . from DateTime )) ĊĠĠĠĠĠĠĠ ĠassertEquals (" 3 1 . 1 2 .$ year Ġ 2 3 : 5 9 : 5 9 . 9 9 9 ", ĠdateTime Formatter . print ( interval . to DateTime )) ĊĠĠĠĠĠĠĠ ĠassertEquals ( year . toString (), Ġinterval . toString ( mock Resources )) ĊĠĠĠ Ġ} Ċ } Ċ