package Ġcom . art em che p . bind in Ċ Ċ import Ġandroidx . arch . core . executor . testing . Instant Task Executor Rule Ċ import Ġandroidx . lifecycle . Lifecycle Ċ import Ġandroidx . lifecycle . Lifecycle Owner Ċ import Ġandroidx . lifecycle . Lifecycle Registry Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġkotlinx . coroutines . test . Test Coroutine Dispatcher Ċ import Ġkotlinx . coroutines . test . reset Main Ċ import Ġkotlinx . coroutines . test . set Main Ċ import Ġorg . junit . After Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . rules . Test Rule Ċ Ċ open Ġclass ĠBind In Test Ġ: ĠLifecycle Owner Ġ{ ĊĠĠĠ Ġprotected Ġval Ġlifecycle Registry Ġ= ĠLifecycle Registry ( this ) ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġval Ġrule : ĠTest Rule Ġ= ĠInstant Task Executor Rule () ĊĊĠĠĠ Ġprivate Ġval Ġtest Dispatcher Ġ= ĠTest Coroutine Dispatcher () ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġbefore () Ġ{ ĊĠĠĠĠĠĠĠ ĠDispatch ers . set Main ( test Dispatcher ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ After ĊĠĠĠ Ġfun Ġafter () Ġ{ ĊĠĠĠĠĠĠĠ ĠDispatch ers . reset Main () ĊĠĠĠĠĠĠĠ Ġtest Dispatcher . cleanup Test Cor outines () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Lifecycle (): ĠLifecycle Ġ= Ġlifecycle Registry Ċ } Ċ