package Ġcom . bad oo . ri bs . android . lifecycle Ċ Ċ import Ġandroidx . lifecycle . Lifecycle Ċ import Ġcom . bad oo . ri bs . test . R ib s Rule Ċ import Ġcom . bad oo . ri bs . test . empty Build Params Ċ import Ġcom . bad oo . ri bs . test . util . finish Activity Sync Ċ import Ġcom . bad oo . ri bs . test . util . ri bs . root . Test Root Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ Ċ class ĠRoot Node Lifecycle Test Ġ{ ĊĠĠĠ Ġprivate Ġval Ġprovider Ġ= ĠTest Root . Provider () ĊĠĠĠ Ġval Ġnode Ġget () Ġ= Ġprovider . root Node !! ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġval Ġri bs Rule Ġ= ĠR ib s Rule Ġ{ Ġactivity , ĠsavedInstanceState Ġ-> ĊĠĠĠĠĠĠĠ Ġprovider . create ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbuild Params Ġ= Ġempty Build Params (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdialog Launcher Ġ= Ġactivity . integration Point . dialog Launcher , Ġ// ĠTODO Ġre consider Ġif Ġwe Ġneed Ġdirect Ġdependency Ġat Ġall ĊĠĠĠĠĠĠĠĠĠĠĠ ĠsavedInstanceState Ġ= ĠsavedInstanceState ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen Activity Res umed _ node Is Attached () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( node . is Attached ). isTrue () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen Activity Res umed _ view Is Attached () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( node . is Attached To View ). isTrue () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen Activity Res umed _ lifecycle Events Are Dis patched () Ġ{ ĊĠĠĠĠĠĠĠ Ġprovider . view Lifecycle Observer . assert Values ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLifecycle . Event . ON _ CREATE , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLifecycle . Event . ON _ START , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLifecycle . Event . ON _ RE SU ME ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen Activity Destroyed _ node Is Detached () Ġ{ ĊĠĠĠĠĠĠĠ Ġri bs Rule . finish Activity Sync () ĊĊĠĠĠĠĠĠĠ ĠassertThat ( node . is Attached ). isFalse () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen Activity Destroyed _ view Is Detached () Ġ{ ĊĠĠĠĠĠĠĠ Ġri bs Rule . finish Activity Sync () ĊĊĠĠĠĠĠĠĠ ĠassertThat ( node . is Attached To View ). isFalse () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen Activity Destroyed _ lifecycle Events Are Dis patched () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġview Lifecycle Observer Ġ= Ġprovider . view Lifecycle Observer ĊĠĠĠĠĠĠĠ Ġview Lifecycle Observer . clear () ĊĊĠĠĠĠĠĠĠ Ġri bs Rule . finish Activity Sync () ĊĊĠĠĠĠĠĠĠ Ġview Lifecycle Observer . assert Values ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLifecycle . Event . ON _ PAUSE , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLifecycle . Event . ON _ STOP , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLifecycle . Event . ON _ DESTROY ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ } Ċ