package Ġdeb op 4 k . time period Ċ Ċ import Ġdeb op 4 k . time period . models . Period Relation Ċ import Ġdeb op 4 k . time period . samples . Time Range Period Relation TestData Ċ import Ġdeb op 4 k . time period . utils .* Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . joda . time . DateTime Ċ import Ġorg . joda . time . Duration Ċ import Ġorg . junit . Test ĊĊ Ċ /** Ċ Ġ* ĠTime Range Kotlin Test Ċ Ġ* Ġ@ author Ġsun gh you k . bae @ gmail . com Ċ Ġ*/ Ċ class ĠTime Range Kotlin Test Ġ: ĠAbstract Time Period Kotlin Test () Ġ{ ĊĊĠ Ġval Ġduration Ġ= ĠDuration ( Dur ations . hour Of ( 1 )) ĊĠ Ġval Ġoffset Ġ= ĠDur ations . Second ĊĊĠ Ġval Ġstart Ġ= Ġnow () ĊĠ Ġval Ġend Ġ= Ġstart Ġ+ Ġduration ĊĠ Ġval ĠtestData Ġ= ĠTime Range Period Relation TestData ( start , Ġend , Ġoffset ) ĊĊĠ Ġ@ Test Ġfun Ġtest Any Time () Ġ{ ĊĠĠĠ ĠassertThat ( Time Range . Any Time . start ). isEqualTo ( Min Period Time ) ĊĠĠĠ ĠassertThat ( Time Range . Any Time . end ). isEqualTo ( Max Period Time ) ĊĊĠĠĠ ĠassertThat ( Time Range . Any Time . is Any Time ). isTrue () ĊĠĠĠ ĠassertThat ( Time Range . Any Time . readonly ). isTrue () ĊĊĠĠĠ ĠassertThat ( Time Range . Any Time . has Period ). isFalse () ĊĠĠĠ ĠassertThat ( Time Range . Any Time . has Start ). isFalse () ĊĠĠĠ ĠassertThat ( Time Range . Any Time . has End ). isFalse () ĊĠĠĠ ĠassertThat ( Time Range . Any Time . is Moment ). isFalse () ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġdefault Contr uctor Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range () ĊĊĠĠĠ ĠassertThat ( range ). isNot EqualTo ( Time Range . Any Time ) ĊĠĠĠ ĠassertThat ( range . relation With ( Time Range . Any Time )). isEqualTo ( Period Relation . Exact Match ) ĊĊĠĠĠ ĠassertThat ( range . is Any Time ). isTrue () ĊĠĠĠ ĠassertThat ( range . readonly ). isFalse () ĊĊĠĠĠ ĠassertThat ( range . has Period ). isFalse () ĊĠĠĠ ĠassertThat ( range . has Start ). isFalse () ĊĠĠĠ ĠassertThat ( range . has End ). isFalse () ĊĠĠĠ ĠassertThat ( range . is Moment ). isFalse () ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġmoment Test () Ġ{ ĊĠĠĠ Ġval Ġmoment Ġ= Ġnow () ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( moment ) ĊĊĠĠĠ ĠassertThat ( range . has Start ). isTrue () ĊĠĠĠ ĠassertThat ( range . has End ). isTrue () ĊĠĠĠ ĠassertThat ( range . duration ). isEqualTo ( Min Duration ) ĊĊĠĠĠ ĠassertThat ( range . is Any Time ). isFalse () ĊĠĠĠ ĠassertThat ( range . is Moment ). isTrue () ĊĠĠĠ ĠassertThat ( range . has Period ). isTrue () ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġmoment By Period () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( now (), ĠDuration . ZERO ) ĊĠĠĠ ĠassertThat ( range . is Moment ). isTrue () ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġnon Moment Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( now (), ĠMin Positive Duration ) ĊĠĠĠ ĠassertThat ( range . is Moment ). isFalse () ĊĠĠĠ ĠassertThat ( range . duration ). isEqualTo ( Min Positive Duration ) ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġhas Start Test () Ġ{ ĊĠĠĠ Ġ// ĠíĺĦ ìŀ¬ ë¶Ģ íĦ° Ġ~ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( now (), Ġnull Ġas ĠDateTime ?) ĊĠĠĠ ĠassertThat ( range . has Start ). isTrue () ĊĠĠĠ ĠassertThat ( range . has End ). isFalse () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġhas End Test () Ġ{ ĊĠĠĠ Ġ// Ġ Ġ~ ĠíĺĦ ìŀ¬ ê¹Įì§Ģ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( null Ġas ĠDateTime ?, Ġnow ()) ĊĠĠĠ ĠassertThat ( range . has Start ). isFalse () ĊĠĠĠ ĠassertThat ( range . has End ). isTrue () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġstart End Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start ) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĠĠĠ ĠassertThat ( range . duration ). isEqualTo ( duration ) ĊĊĠĠĠ ĠassertThat ( range . has Period ). isTrue () ĊĠĠĠ ĠassertThat ( range . is Any Time ). isFalse () ĊĠĠĠ ĠassertThat ( range . is Moment ). isFalse () ĊĠĠĠ ĠassertThat ( range . readonly ). isFalse () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġstart End Swap Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( end , Ġstart ) ĊĠĠĠ Ġassert Time Range Creator ( range ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġstart And Duration Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġduration ) ĊĠĠĠ Ġassert Time Range Creator ( range ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġassert Time Range Creator ( range : ĠTime Range ) Ġ{ ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start ) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĠĠĠ ĠassertThat ( range . duration ). isEqualTo ( duration ) ĊĊĠĠĠ ĠassertThat ( range . has Period ). isTrue () ĊĠĠĠ ĠassertThat ( range . is Any Time ). isFalse () ĊĠĠĠ ĠassertThat ( range . is Moment ). isFalse () ĊĠĠĠ ĠassertThat ( range . readonly ). isFalse () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġstart And Neg ate Duration Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , ĠDur ations . neg ate ( duration )) ĊĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start . minus ( duration )) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end . minus ( duration )) ĊĠĠĠ ĠassertThat ( range . duration ). isEqualTo ( duration ) ĊĊĠĠĠ ĠassertThat ( range . has Period ). isTrue () ĊĠĠĠ ĠassertThat ( range . is Any Time ). isFalse () ĊĠĠĠ ĠassertThat ( range . is Moment ). isFalse () ĊĠĠĠ ĠassertThat ( range . readonly ). isFalse () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġcopy Constructor Test () Ġ{ ĊĠĠĠ Ġval Ġsource Ġ= ĠTime Range ( start , Ġstart . plus Hours ( 1 ), Ġtrue ) ĊĠĠĠ Ġval Ġcopy Ġ= ĠTime Range ( source ) ĊĊĠĠĠ ĠassertThat ( copy . start ). isEqualTo ( source . start ) ĊĠĠĠ ĠassertThat ( copy . end ). isEqualTo ( source . end ) ĊĠĠĠ ĠassertThat ( copy . duration ). isEqualTo ( source . duration ) ĊĊĠĠĠ ĠassertThat ( copy . readonly ). isEqualTo ( source . readonly ) ĊĊĠĠĠ ĠassertThat ( copy . has Period ). isTrue () ĊĠĠĠ ĠassertThat ( copy . is Any Time ). isFalse () ĊĠĠĠ ĠassertThat ( copy . is Moment ). isFalse () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġstart Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġstart . plus Hours ( 1 )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start ) ĊĊĠĠĠ Ġval Ġchan ed Start Ġ= Ġstart . plus Hours ( 1 ) ĊĠĠĠ Ġrange . start Ġ= Ġchan ed Start ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( chan ed Start ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ( expected Ġ= ĠAssertionError :: class ) ĊĠ Ġfun Ġstart Readonly Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( now (), ĠDur ations . hour Of ( 1 ), Ġtrue ) ĊĠĠĠ Ġrange . start Ġ= Ġrange . start . minus Hours ( 2 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ( expected Ġ= ĠAssertionError :: class ) ĊĠ Ġfun Ġstart OutOfRange Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( now (), ĠDur ations . hour Of ( 1 ), Ġfalse ) ĊĠĠĠ Ġrange . start Ġ= Ġrange . start . plus Hours ( 2 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġ@ Throws ( Exception :: class ) ĊĠ Ġfun Ġend Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( end . minus Hours ( 1 ), Ġend ) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĊĠĠĠ Ġval Ġchanged End Ġ= Ġend . plus Hours ( 1 ) ĊĠĠĠ Ġrange . end Ġ= Ġchanged End ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( changed End ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ( expected Ġ= ĠAssertionError :: class ) ĊĠ Ġfun Ġend Readonly Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( now (), ĠDur ations . hour Of ( 1 ), Ġtrue ) ĊĠĠĠ Ġrange . end Ġ= Ġrange . end . plus Hours ( 1 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ( expected Ġ= ĠAssertionError :: class ) ĊĠ Ġfun Ġend OutOfRange Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( now (), ĠDur ations . hour Of ( 1 ), Ġfalse ) ĊĠĠĠ Ġrange . end Ġ= Ġrange . end . minus Hours ( 2 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġhas Inside DateTime Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĊĠĠĠ ĠassertThat ( range . has Inside ( start . minus ( duration ))). isFalse () ĊĠĠĠ ĠassertThat ( range . has Inside ( start )). isTrue () ĊĠĠĠ ĠassertThat ( range . has Inside ( start . plus ( duration ))). isTrue () ĊĊĠĠĠ ĠassertThat ( range . has Inside ( end . minus ( duration ))). isTrue () ĊĠĠĠ ĠassertThat ( range . has Inside ( end )). isTrue () ĊĠĠĠ ĠassertThat ( range . has Inside ( end . plus ( duration ))). isFalse () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġhas Inside Period Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĊĠĠĠ Ġ// Ġbefore ĊĠĠĠ Ġval Ġbefore 1 Ġ= ĠTime Range ( start . minus Hours ( 2 ), Ġstart . minus Hours ( 1 )) ĊĠĠĠ Ġval Ġbefore 2 Ġ= ĠTime Range ( start . minus Millis ( 1 ), Ġend ) ĊĠĠĠ Ġval Ġbefore 3 Ġ= ĠTime Range ( start . minus Millis ( 1 ), Ġstart ) ĊĊĠĠĠ ĠassertThat ( range . has Inside ( before 1 )). isFalse () ĊĠĠĠ ĠassertThat ( range . has Inside ( before 2 )). isFalse () ĊĠĠĠ ĠassertThat ( range . has Inside ( before 3 )). isFalse () ĊĊĠĠĠ Ġ// Ġafter ĊĠĠĠ Ġval Ġafter 1 Ġ= ĠTime Range ( start . plus Hours ( 1 ), Ġend . plus Hours ( 1 )) ĊĠĠĠ Ġval Ġafter 2 Ġ= ĠTime Range ( start , Ġend . plus Millis ( 1 )) ĊĠĠĠ Ġval Ġafter 3 Ġ= ĠTime Range ( end , Ġend . plus Millis ( 1 )) ĊĊĠĠĠ ĠassertThat ( range . has Inside ( after 1 )). isFalse () ĊĠĠĠ ĠassertThat ( range . has Inside ( after 2 )). isFalse () ĊĠĠĠ ĠassertThat ( range . has Inside ( after 3 )). isFalse () ĊĊĠĠĠ Ġ// Ġinside ĊĠĠĠ ĠassertThat ( range . has Inside ( range )). isTrue () ĊĊĠĠĠ Ġval Ġinside 1 Ġ= ĠTime Range ( start . plus Millis ( 1 ), Ġend ) ĊĠĠĠ Ġval Ġinside 2 Ġ= ĠTime Range ( start . plus Millis ( 1 ), Ġend . minus Millis ( 1 )) ĊĠĠĠ Ġval Ġinside 3 Ġ= ĠTime Range ( start , Ġend . minus Millis ( 1 )) ĊĊĠĠĠ ĠassertThat ( range . has Inside ( inside 1 )). isTrue () ĊĠĠĠ ĠassertThat ( range . has Inside ( inside 2 )). isTrue () ĊĠĠĠ ĠassertThat ( range . has Inside ( inside 3 )). isTrue () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġcopy Test () Ġ{ ĊĠĠĠ Ġval Ġreadonly Time Range Ġ= ĠTime Range ( start , Ġend ) ĊĠĠĠ ĠassertThat ( readonly Time Range . copy ()). isEqualTo ( readonly Time Range ) ĊĠĠĠ ĠassertThat ( readonly Time Range . copy ( Duration . ZERO )). isEqualTo ( readonly Time Range ) ĊĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start ) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĊĠĠĠ Ġval Ġno Move Ġ= Ġrange . copy ( Dur ations . Zero ) Ġas ĠTime Range ĊĊĠĠĠ ĠassertThat ( no Move . start ). isEqualTo ( range . start ) ĊĠĠĠ ĠassertThat ( no Move . end ). isEqualTo ( range . end ) ĊĠĠĠ ĠassertThat ( no Move . duration ). isEqualTo ( range . duration ) ĊĠĠĠ ĠassertThat ( no Move ). isEqualTo ( no Move ) ĊĊĠĠĠ Ġval Ġforward Offset Ġ= ĠDur ations . hour Of ( 2 , Ġ 3 0 , Ġ 1 5 ) ĊĠĠĠ Ġval Ġforward Ġ= Ġrange . copy ( forward Offset ) Ġas ĠTime Range ĊĊĠĠĠ ĠassertThat ( forward . start ). isEqualTo ( start . plus ( forward Offset )) ĊĠĠĠ ĠassertThat ( forward . end ). isEqualTo ( end . plus ( forward Offset )) ĊĠĠĠ ĠassertThat ( forward . duration ). isEqualTo ( duration ) ĊĊĠĠĠ Ġval Ġbackward Offset Ġ= ĠDur ations . hour Of (- 1 , Ġ 1 0 , Ġ 3 0 ) ĊĠĠĠ Ġval Ġbackward Ġ= Ġrange . copy ( backward Offset ) Ġas ĠTime Range ĊĊĠĠĠ ĠassertThat ( backward . start ). isEqualTo ( start . plus ( backward Offset )) ĊĠĠĠ ĠassertThat ( backward . end ). isEqualTo ( end . plus ( backward Offset )) ĊĠĠĠ ĠassertThat ( backward . duration ). isEqualTo ( duration ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġmove Test () Ġ{ ĊĠĠĠ Ġval Ġmove Zero Ġ= ĠTime Range ( start , Ġend ) ĊĠĠĠ Ġmove Zero . move ( Dur ations . Zero ) ĊĠĠĠ ĠassertThat ( move Zero . start ). isEqualTo ( start ) ĊĠĠĠ ĠassertThat ( move Zero . end ). isEqualTo ( end ) ĊĠĠĠ ĠassertThat ( move Zero . duration ). isEqualTo ( duration ) ĊĊĠĠĠ Ġval Ġforward Ġ= ĠTime Range ( start , Ġend ) ĊĠĠĠ Ġval Ġforward Offset Ġ= ĠDur ations . hour Of ( 2 , Ġ 3 0 , Ġ 1 5 ) ĊĠĠĠ Ġforward . move ( forward Offset ) ĊĊĠĠĠ ĠassertThat ( forward . start ). isEqualTo ( start . plus ( forward Offset )) ĊĠĠĠ ĠassertThat ( forward . end ). isEqualTo ( end . plus ( forward Offset )) ĊĠĠĠ ĠassertThat ( forward . duration ). isEqualTo ( duration ) ĊĊĠĠĠ Ġval Ġbackward Ġ= ĠTime Range ( start , Ġend ) ĊĠĠĠ Ġval Ġbackward Offset Ġ= ĠDur ations . hour Of (- 1 , Ġ 1 0 , Ġ 3 0 ) ĊĠĠĠ Ġbackward . move ( backward Offset ) ĊĊĠĠĠ ĠassertThat ( backward . start ). isEqualTo ( start . plus ( backward Offset )) ĊĠĠĠ ĠassertThat ( backward . end ). isEqualTo ( end . plus ( backward Offset )) ĊĠĠĠ ĠassertThat ( backward . duration ). isEqualTo ( duration ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġexpand Start To Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ Ġrange . expand Start To ( start . plus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start ) ĊĊĠĠĠ Ġrange . expand Start To ( start . minus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start . minus Millis ( 1 )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġexpand End To Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ Ġrange . expand End To ( end . minus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĊĠĠĠ Ġrange . expand End To ( end . plus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end . plus Millis ( 1 )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġexpand To DateTime Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ Ġ// Ġstart ĊĠĠĠ Ġrange . expand To ( start . plus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start ) ĊĊĠĠĠ Ġrange . expand To ( start . minus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start . minus Millis ( 1 )) ĊĊĠĠĠ Ġ// Ġend Inclusive ĊĠĠĠ Ġrange . expand To ( end . minus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĊĠĠĠ Ġrange . expand To ( end . plus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end . plus Millis ( 1 )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġexpand To Period Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ Ġ// Ġno Ġexpansion ĊĠĠĠ Ġrange . expand To ( Time Range ( start . plus Millis ( 1 ), Ġend . minus Millis ( 1 ))) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start ) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĊĠĠĠ Ġ// Ġstart ĊĠĠĠ Ġvar Ġchanged Start Ġ= Ġstart . minus Minutes ( 1 ) ĊĠĠĠ Ġrange . expand To ( Time Range ( changed Start , Ġend )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( changed Start ) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĊĠĠĠ Ġ// Ġend Inclusive ĊĠĠĠ Ġvar Ġchanged End Ġ= Ġend . plus Minutes ( 1 ) ĊĠĠĠ Ġrange . expand To ( Time Range ( changed Start , Ġchanged End )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( changed Start ) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( changed End ) ĊĊĠĠĠ Ġ// Ġstart / end Inclusive ĊĠĠĠ Ġchanged Start Ġ= Ġchanged Start . minus Minutes ( 1 ) ĊĠĠĠ Ġchanged End Ġ= Ġchanged End . plus Minutes ( 1 ) ĊĠĠĠ Ġrange . expand To ( Time Range ( changed Start , Ġchanged End )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( changed Start ) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( changed End ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshrink Start To Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ Ġrange . shrink Start To ( start . minus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start ) ĊĊĠĠĠ Ġrange . shrink Start To ( start . plus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start . plus Millis ( 1 )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshrink End To Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ Ġrange . shrink End To ( end . plus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĊĠĠĠ Ġrange . shrink End To ( end . minus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end . minus Millis ( 1 )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshrink To DateTime Test () Ġ{ ĊĠĠĠ Ġvar Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ Ġ// Ġstart ĊĠĠĠ Ġrange . shrink To ( start . minus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start ) ĊĊĠĠĠ Ġrange . shrink To ( start . plus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start . plus Millis ( 1 )) ĊĊĠĠĠ Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ Ġ// Ġend Inclusive ĊĠĠĠ Ġrange . shrink To ( end . plus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĊĠĠĠ Ġrange . shrink To ( end . minus Millis ( 1 )) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end . minus Millis ( 1 )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshrink To Period Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ Ġ// Ġno Ġexpansion ĊĠĠĠ Ġrange . shrink To ( Time Range ( start . minus Millis ( 1 ), Ġend . plus Millis ( 1 ))) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start ) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĊĠĠĠ Ġ// Ġstart ĊĠĠĠ Ġvar Ġchanged Start Ġ= Ġstart . plus Minutes ( 1 ) ĊĠĠĠ Ġrange . shrink To ( Time Range ( changed Start , Ġend )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( changed Start ) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĊĠĠĠ Ġ// Ġend Inclusive ĊĠĠĠ Ġvar Ġchanged End Ġ= Ġend . minus Minutes ( 1 ) ĊĠĠĠ Ġrange . shrink To ( Time Range ( changed Start , Ġchanged End )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( changed Start ) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( changed End ) ĊĊĠĠĠ Ġ// Ġstart / end Inclusive ĊĠĠĠ Ġchanged Start Ġ= Ġchanged Start . plus Minutes ( 1 ) ĊĠĠĠ Ġchanged End Ġ= Ġchanged End . minus Minutes ( 1 ) ĊĠĠĠ Ġrange . shrink To ( Time Range ( changed Start , Ġchanged End )) ĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( changed Start ) ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( changed End ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġis Same Period Test () Ġ{ ĊĠĠĠ Ġval Ġrange 1 Ġ= ĠTime Range ( start , Ġend ) ĊĠĠĠ Ġval Ġrange 2 Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ ĠassertThat ( range 1 . is Same Period ( range 1 )). isTrue () ĊĠĠĠ ĠassertThat ( range 2 . is Same Period ( range 2 )). isTrue () ĊĊĠĠĠ ĠassertThat ( range 1 . is Same Period ( range 2 )). isTrue () ĊĠĠĠ ĠassertThat ( range 2 . is Same Period ( range 1 )). isTrue () ĊĊĠĠĠ ĠassertThat ( range 1 . is Same Period ( Time Range . Any Time )). isFalse () ĊĠĠĠ ĠassertThat ( range 2 . is Same Period ( Time Range . Any Time )). isFalse () ĊĊĠĠĠ Ġrange 1 . move ( Dur ations . Millisecond ) ĊĠĠĠ ĠassertThat ( range 1 . is Same Period ( range 2 )). isFalse () ĊĠĠĠ ĠassertThat ( range 2 . is Same Period ( range 1 )). isFalse () ĊĊĠĠĠ Ġrange 1 . move ( Dur ations . millis Of (- 1 )) ĊĠĠĠ ĠassertThat ( range 1 . is Same Period ( range 2 )). isTrue () ĊĠĠĠ ĠassertThat ( range 2 . is Same Period ( range 1 )). isTrue () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġhas Inside Test () Ġ{ ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . before )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . start Touch ing )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . start Inside )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . inside Start Touch ing )). isFalse () ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . enc lo sing Start Touch ing )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . enc lo sing )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . enc lo sing End Touch ing )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . exact Match )). isTrue () ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . inside )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . inside End Touch ing )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . end Touch ing )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . after )). isFalse () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġintersect sWith Test () Ġ{ ĊĊĠĠĠ ĠassertThat ( testData . reference . intersect sWith ( testData . before )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . intersect sWith ( testData . start Touch ing )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . intersect sWith ( testData . start Inside )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . intersect sWith ( testData . inside Start Touch ing )). isTrue () ĊĊĠĠĠ ĠassertThat ( testData . reference . intersect sWith ( testData . enc lo sing Start Touch ing )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . intersect sWith ( testData . enc lo sing )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . intersect sWith ( testData . enc lo sing End Touch ing )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . intersect sWith ( testData . exact Match )). isTrue () ĊĊĠĠĠ ĠassertThat ( testData . reference . intersect sWith ( testData . inside )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . intersect sWith ( testData . inside End Touch ing )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . intersect sWith ( testData . end Touch ing )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . intersect sWith ( testData . after )). isFalse () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġoverlap sWith Test () Ġ{ ĊĊĠĠĠ ĠassertThat ( testData . reference . overlap sWith ( testData . before )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . overlap sWith ( testData . start Touch ing )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . overlap sWith ( testData . start Inside )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . overlap sWith ( testData . inside Start Touch ing )). isTrue () ĊĊĠĠĠ ĠassertThat ( testData . reference . overlap sWith ( testData . enc lo sing Start Touch ing )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . overlap sWith ( testData . enc lo sing )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . overlap sWith ( testData . enc lo sing End Touch ing )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . overlap sWith ( testData . exact Match )). isTrue () ĊĊĠĠĠ ĠassertThat ( testData . reference . overlap sWith ( testData . inside )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . overlap sWith ( testData . inside End Touch ing )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . overlap sWith ( testData . end Touch ing )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . overlap sWith ( testData . after )). isFalse () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġintersect sWith DateTime Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ Ġ// Ġbefore ĊĠĠĠ ĠassertThat ( range . intersect sWith ( Time Range ( start . minus Hours ( 2 ), Ġstart . minus Hours ( 1 )) )). isFalse () ĊĠĠĠ ĠassertThat ( range . intersect sWith ( Time Range ( start . minus Hours ( 1 ), Ġstart ))). isTrue () ĊĠĠĠ ĠassertThat ( range . intersect sWith ( Time Range ( start . minus Hours ( 1 ), Ġstart . plus Millis ( 1 )) )). isTrue () ĊĊĠĠĠ Ġ// Ġafter ĊĠĠĠ ĠassertThat ( range . intersect sWith ( Time Range ( end . plus Hours ( 1 ), Ġend . plus Hours ( 2 )) )). isFalse () ĊĠĠĠ ĠassertThat ( range . intersect sWith ( Time Range ( end , Ġend . plus Millis ( 1 )) )). isTrue () ĊĠĠĠ ĠassertThat ( range . intersect sWith ( Time Range ( end . minus Millis ( 1 ), Ġend . plus Millis ( 1 )) )). isTrue () ĊĊĠĠĠ Ġ// Ġintersect ĊĠĠĠ ĠassertThat ( range . intersect sWith ( range )). isTrue () ĊĠĠĠ ĠassertThat ( range . intersect sWith ( Time Range ( start . minus Millis ( 1 ), Ġend . plus Hours ( 2 )) )). isTrue () ĊĠĠĠ ĠassertThat ( range . intersect sWith ( Time Range ( start . minus Millis ( 1 ), Ġstart . plus Millis ( 1 )) )). isTrue () ĊĠĠĠ ĠassertThat ( range . intersect sWith ( Time Range ( end . minus Millis ( 1 ), Ġend . plus Millis ( 1 )) )). isTrue () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġget Intersection Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ Ġ// Ġbefore ĊĠĠĠ ĠassertThat ( range . intersection ( Time Range ( start . minus Hours ( 2 ), Ġstart . minus Hours ( 1 )) )). isNull () ĊĠĠĠ ĠassertThat ( range . intersection ( Time Range ( start . minus Millis ( 1 ), Ġstart ))). isEqualTo ( Time Range ( start )) ĊĠĠĠ ĠassertThat ( range . intersection ( Time Range ( start . minus Hours ( 1 ), Ġstart . plus Millis ( 1 )) )). isEqualTo ( Time Range ( start , Ġstart . plus Millis ( 1 ))) ĊĊĠĠĠ Ġ// Ġafter ĊĠĠĠ ĠassertThat ( range . intersection ( Time Range ( end . plus Hours ( 1 ), Ġend . plus Hours ( 2 )) )). isNull () ĊĠĠĠ ĠassertThat ( range . intersection ( Time Range ( end , Ġend . plus Millis ( 1 )) )). isEqualTo ( Time Range ( end )) ĊĠĠĠ ĠassertThat ( range . intersection ( Time Range ( end . minus Millis ( 1 ), Ġend . plus Millis ( 1 )) )). isEqualTo ( Time Range ( end . minus Millis ( 1 ), Ġend )) ĊĊĠĠĠ Ġ// Ġintersect ĊĠĠĠ ĠassertThat ( range . intersection ( range )). isEqualTo ( range ) ĊĠĠĠ ĠassertThat ( range . intersection ( Time Range ( start . minus Millis ( 1 ), Ġend . plus Millis ( 1 )) )). isEqualTo ( range ) ĊĠĠĠ ĠassertThat ( range . intersection ( Time Range ( start . plus Millis ( 1 ), Ġend . minus Millis ( 1 )) )). isEqualTo ( Time Range ( start . plus Millis ( 1 ), Ġend . minus Millis ( 1 ))) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġget Relation Test () Ġ{ ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . before )). isEqualTo ( Period Relation . Before ) ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . start Touch ing )). isEqualTo ( Period Relation . Start Touch ing ) ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . start Inside )). isEqualTo ( Period Relation . Start Inside ) ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . inside Start Touch ing )). isEqualTo ( Period Relation . Inside Start Touch ing ) ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . enc lo sing )). isEqualTo ( Period Relation . En closing ) ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . exact Match )). isEqualTo ( Period Relation . Exact Match ) ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . inside )). isEqualTo ( Period Relation . Inside ) ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . inside End Touch ing )). isEqualTo ( Period Relation . Inside End Touch ing ) ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . end Inside )). isEqualTo ( Period Relation . End Inside ) ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . end Touch ing )). isEqualTo ( Period Relation . End Touch ing ) ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . after )). isEqualTo ( Period Relation . After ) ĊĊĠĠĠ Ġ// Ġreference ĊĠĠĠ ĠassertThat ( testData . reference . start ). isEqualTo ( start ) ĊĠĠĠ ĠassertThat ( testData . reference . end ). isEqualTo ( end ) ĊĠĠĠ ĠassertThat ( testData . reference . readonly ). isTrue () ĊĊĠĠĠ Ġ// Ġafter ĊĠĠĠ ĠassertThat ( testData . after . readonly ). isTrue () ĊĠĠĠ ĠassertThat ( testData . after . start . compareTo ( start )). is LessThan ( 0 ) ĊĠĠĠ ĠassertThat ( testData . after . end . compareTo ( start )). is LessThan ( 0 ) ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . after . start )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . after . end )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . after )). isEqualTo ( Period Relation . After ) ĊĊĠĠĠ Ġ// Ġstart Ġtouch ing ĊĠĠĠ ĠassertThat ( testData . start Touch ing . readonly ). isTrue () ĊĠĠĠ ĠassertThat ( testData . start Touch ing . start . millis ). is LessThan ( start . millis ) ĊĠĠĠ ĠassertThat ( testData . start Touch ing . end ). isEqualTo ( start ) ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . start Touch ing . start )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . start Touch ing . end )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . start Touch ing )). isEqualTo ( Period Relation . Start Touch ing ) ĊĊĠĠĠ Ġ// Ġstart Ġinside ĊĠĠĠ ĠassertThat ( testData . start Inside . readonly ). isTrue () ĊĠĠĠ ĠassertThat ( testData . start Inside . start . millis ). is LessThan ( start . millis ) ĊĠĠĠ ĠassertThat ( testData . start Inside . end . millis ). is LessThan ( end . millis ) ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . start Inside . start )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . start Inside . end )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . start Inside )). isEqualTo ( Period Relation . Start Inside ) ĊĊĠĠĠ Ġ// Ġinside Ġstart Ġtouch ing ĊĠĠĠ ĠassertThat ( testData . inside Start Touch ing . readonly ). isTrue () ĊĠĠĠ ĠassertThat ( testData . inside Start Touch ing . start . millis ). isEqualTo ( start . millis ) ĊĠĠĠ ĠassertThat ( testData . inside Start Touch ing . end . millis ). is GreaterThan ( end . millis ) ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . inside Start Touch ing . start )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . inside Start Touch ing . end )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . inside Start Touch ing )). isEqualTo ( Period Relation . Inside Start Touch ing ) ĊĊĠĠĠ Ġ// Ġen closing Ġstart Ġtouch ing ĊĠĠĠ ĠassertThat ( testData . inside Start Touch ing . readonly ). isTrue () ĊĠĠĠ ĠassertThat ( testData . inside Start Touch ing . start . millis ). isEqualTo ( start . millis ) ĊĠĠĠ ĠassertThat ( testData . inside Start Touch ing . end . millis ). is GreaterThan ( end . millis ) ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . inside Start Touch ing . start )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . inside Start Touch ing . end )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . inside Start Touch ing )). isEqualTo ( Period Relation . Inside Start Touch ing ) ĊĊĠĠĠ Ġ// Ġen closing ĊĠĠĠ ĠassertThat ( testData . enc lo sing . readonly ). isTrue () ĊĠĠĠ ĠassertThat ( testData . enc lo sing . start . millis ). is GreaterThan ( start . millis ) ĊĠĠĠ ĠassertThat ( testData . enc lo sing . end . millis ). is LessThan ( end . millis ) ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . enc lo sing . start )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . enc lo sing . end )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . enc lo sing )). isEqualTo ( Period Relation . En closing ) ĊĊĠĠĠ Ġ// Ġen closing Ġend Inclusive Ġtouch ing ĊĠĠĠ ĠassertThat ( testData . enc lo sing End Touch ing . readonly ). isTrue () ĊĠĠĠ ĠassertThat ( testData . enc lo sing End Touch ing . start . millis ). is GreaterThan ( start . millis ) ĊĠĠĠ ĠassertThat ( testData . enc lo sing End Touch ing . end . millis ). isEqualTo ( end . millis ) ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . enc lo sing End Touch ing . start )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . enc lo sing End Touch ing . end )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . enc lo sing End Touch ing )). isEqualTo ( Period Relation . En closing End Touch ing ) ĊĊĠĠĠ Ġ// Ġexact Ġmatch ĊĠĠĠ ĠassertThat ( testData . exact Match . readonly ). isTrue () ĊĠĠĠ ĠassertThat ( testData . exact Match . start . millis ). isEqualTo ( start . millis ) ĊĠĠĠ ĠassertThat ( testData . exact Match . end . millis ). isEqualTo ( end . millis ) ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . exact Match . start )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . exact Match . end )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . exact Match )). isEqualTo ( Period Relation . Exact Match ) ĊĊĠĠĠ Ġ// Ġinside ĊĠĠĠ ĠassertThat ( testData . inside . readonly ). isTrue () ĊĠĠĠ ĠassertThat ( testData . inside . start . millis ). is LessThan ( start . millis ) ĊĠĠĠ ĠassertThat ( testData . inside . end . millis ). is GreaterThan ( end . millis ) ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . inside . start )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . inside . end )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . inside )). isEqualTo ( Period Relation . Inside ) ĊĊĠĠĠ Ġ// Ġinside Ġend Inclusive Ġtouch ing ĊĠĠĠ ĠassertThat ( testData . inside End Touch ing . readonly ). isTrue () ĊĠĠĠ ĠassertThat ( testData . inside End Touch ing . start . millis ). is LessThan ( start . millis ) ĊĠĠĠ ĠassertThat ( testData . inside End Touch ing . end . millis ). isEqualTo ( end . millis ) ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . inside End Touch ing . start )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . inside End Touch ing . end )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . inside End Touch ing )). isEqualTo ( Period Relation . Inside End Touch ing ) ĊĊĠĠĠ Ġ// Ġend Inclusive Ġinside ĊĠĠĠ ĠassertThat ( testData . end Inside . readonly ). isTrue () ĊĠĠĠ ĠassertThat ( testData . end Inside . start . millis ). is GreaterThan ( start . millis ) ĊĠĠĠ ĠassertThat ( testData . end Inside . start . millis ). is LessThan ( end . millis ) ĊĠĠĠ ĠassertThat ( testData . end Inside . end . millis ). is GreaterThan ( end . millis ) ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . end Inside . start )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . end Inside . end )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . end Inside )). isEqualTo ( Period Relation . End Inside ) ĊĊĠĠĠ Ġ// Ġend Inclusive Ġtouch ing ĊĠĠĠ ĠassertThat ( testData . end Touch ing . readonly ). isTrue () ĊĠĠĠ ĠassertThat ( testData . end Touch ing . start . millis ). isEqualTo ( end . millis ) ĊĠĠĠ ĠassertThat ( testData . end Touch ing . end . millis ). is GreaterThan ( end . millis ) ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . end Touch ing . start )). isTrue () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . end Touch ing . end )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . end Touch ing )). isEqualTo ( Period Relation . End Touch ing ) ĊĊĠĠĠ Ġ// Ġbefore ĊĠĠĠ ĠassertThat ( testData . before . readonly ). isTrue () ĊĠĠĠ ĠassertThat ( testData . before . start . millis ). is GreaterThan ( end . millis ) ĊĠĠĠ ĠassertThat ( testData . before . end . millis ). is GreaterThan ( end . millis ) ĊĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . before . start )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . has Inside ( testData . before . end )). isFalse () ĊĠĠĠ ĠassertThat ( testData . reference . relation ( testData . before )). isEqualTo ( Period Relation . Before ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġreset Test () Ġ{ ĊĠĠĠ Ġval Ġrange Ġ= ĠTime Range ( start , Ġend ) ĊĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( start ) ĊĠĠĠ ĠassertThat ( range . has Start ). isTrue () ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( end ) ĊĠĠĠ ĠassertThat ( range . has End ). isTrue () ĊĊĠĠĠ Ġrange . reset () ĊĊĠĠĠ ĠassertThat ( range . start ). isEqualTo ( Min Period Time ) ĊĠĠĠ ĠassertThat ( range . has Start ). isFalse () ĊĠĠĠ ĠassertThat ( range . end ). isEqualTo ( Max Period Time ) ĊĠĠĠ ĠassertThat ( range . has End ). isFalse () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġequals Test () Ġ{ ĊĠĠĠ Ġval Ġrange 1 Ġ= ĠTime Range ( start , Ġend ) ĊĠĠĠ Ġval Ġrange 2 Ġ= ĠTime Range ( start , Ġend ) ĊĠĠĠ Ġval Ġrange 3 Ġ= ĠTime Range ( start . plus Millis (- 1 ), Ġend . plus Millis ( 1 )) ĊĠĠĠ Ġval Ġrange 4 Ġ= ĠTime Range ( start , Ġend , Ġtrue ) ĊĊĠĠĠ ĠassertThat ( range 1 ). isEqualTo ( range 2 ) ĊĠĠĠ ĠassertThat ( range 1 ). isNot EqualTo ( range 3 ) ĊĠĠĠ ĠassertThat ( range 2 ). isEqualTo ( range 1 ) ĊĠĠĠ ĠassertThat ( range 2 ). isNot EqualTo ( range 3 ) ĊĊĠĠĠ ĠassertThat ( range 1 ). isNot EqualTo ( range 4 ) ĊĠ Ġ} Ċ Ċ }