package Ġcom . bad oo . reak t ive . maybe Ċ Ċ import Ġcom . bad oo . reak t ive . observable . Delay Error Tests Ċ import Ġcom . bad oo . reak t ive . test . base . assert Error Ċ import Ġcom . bad oo . reak t ive . test . maybe . Test Maybe Ċ import Ġcom . bad oo . reak t ive . test . maybe . assert Complete Ċ import Ġcom . bad oo . reak t ive . test . maybe . assertNot Complete Ċ import Ġcom . bad oo . reak t ive . test . maybe . assertNot Success Ċ import Ġcom . bad oo . reak t ive . test . maybe . assert Success Ċ import Ġcom . bad oo . reak t ive . test . maybe . test Ċ import Ġcom . bad oo . reak t ive . test . scheduler . Test Scheduler Ċ import Ġkotlin . test . Test Ċ Ċ class ĠDelay Test Ġ: ĊĠĠĠ ĠMaybe To Maybe Tests Ġby ĠMaybe To Maybe Tests Impl ({ Ġdelay ( 0 L , ĠTest Scheduler ()) Ġ}), ĊĠĠĠ ĠDelay Error Tests Ġby ĠDelay Error Tests < Test Maybe < Int >>( ĊĠĠĠĠĠĠĠ ĠTest Maybe (), ĊĠĠĠĠĠĠĠ Ġ{ Ġdelay Millis , Ġscheduler , Ġdelay Error Ġ-> Ġdelay ( delay Millis , Ġscheduler , Ġdelay Error ). test () Ġ} ĊĠĠĠ Ġ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġupstream Ġ= ĠTest Maybe < Int ?> () ĊĠĠĠ Ġprivate Ġval Ġscheduler Ġ= ĠTest Scheduler () ĊĠĠĠ Ġprivate Ġval Ġtimer Ġ= Ġscheduler . timer ĊĠĠĠ Ġprivate Ġval Ġobserver Ġ= Ġupstream . delay ( 1 0 0 0 L , Ġscheduler ). test () ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġdoes _ not _ suc ceed _ IF _ timeout _ not _ re ached () Ġ{ ĊĠĠĠĠĠĠĠ Ġupstream . on Success ( 0 ) ĊĠĠĠĠĠĠĠ Ġtimer . advance By ( 9 9 9 L ) ĊĊĠĠĠĠĠĠĠ Ġobserver . assertNot Success () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsucceeds _ with _ non _ null _ WHEN _ timeout _ re ached () Ġ{ ĊĠĠĠĠĠĠĠ Ġupstream . on Success ( 0 ) ĊĊĠĠĠĠĠĠĠ Ġtimer . advance By ( 1 0 0 0 L ) ĊĊĠĠĠĠĠĠĠ Ġobserver . assert Success ( 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġsucceeds _ with _ null _ WHEN _ timeout _ re ached () Ġ{ ĊĠĠĠĠĠĠĠ Ġupstream . on Success ( null ) ĊĊĠĠĠĠĠĠĠ Ġtimer . advance By ( 1 0 0 0 L ) ĊĊĠĠĠĠĠĠĠ Ġobserver . assert Success ( null ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġdoes _ not _ complete _ s ynchronously () Ġ{ ĊĠĠĠĠĠĠĠ Ġupstream . onComplete () ĊĊĠĠĠĠĠĠĠ Ġobserver . assertNot Complete () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġdoes _ not _ complete _ IF _ timeout _ not _ re ached () Ġ{ ĊĠĠĠĠĠĠĠ Ġupstream . onComplete () ĊĠĠĠĠĠĠĠ Ġtimer . advance By ( 9 9 9 L ) ĊĊĠĠĠĠĠĠĠ Ġobserver . assertNot Complete () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġcompletes _ WHEN _ timeout _ re ached () Ġ{ ĊĠĠĠĠĠĠĠ Ġupstream . onComplete () ĊĠĠĠĠĠĠĠ Ġtimer . advance By ( 1 0 0 0 L ) ĊĊĠĠĠĠĠĠĠ Ġobserver . assert Complete () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġnot _ delayed _ error _ go es _ before _ pending _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġupstream . on Success ( 0 ) ĊĊĠĠĠĠĠĠĠ Ġupstream . onError ( Throwable ()) ĊĊĠĠĠĠĠĠĠ Ġobserver . assert Error () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġnot _ delayed _ error _ cancel s _ pending _ success () Ġ{ ĊĠĠĠĠĠĠĠ Ġupstream . on Success ( 0 ) ĊĊĠĠĠĠĠĠĠ Ġupstream . onError ( Throwable ()) ĊĊĠĠĠĠĠĠĠ Ġtimer . advance By ( 1 0 0 0 L ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġnot _ delayed _ error _ go es _ before _ pending _ complete () Ġ{ ĊĠĠĠĠĠĠĠ Ġupstream . onComplete () ĊĊĠĠĠĠĠĠĠ Ġupstream . onError ( Throwable ()) ĊĊĠĠĠĠĠĠĠ Ġobserver . assert Error () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġnot _ delayed _ error _ cancel s _ pending _ complete () Ġ{ ĊĠĠĠĠĠĠĠ Ġupstream . onComplete () ĊĊĠĠĠĠĠĠĠ Ġupstream . onError ( Throwable ()) ĊĊĠĠĠĠĠĠĠ Ġtimer . advance By ( 1 0 0 0 L ) ĊĠĠĠ Ġ} Ċ } Ċ