package Ġcom . me li h . detail Ċ Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġkotlinx . coroutines . Experimental Cor outines Api Ċ import Ġkotlinx . coroutines . test . Test Coroutine Dispatcher Ċ import Ġkotlinx . coroutines . test . reset Main Ċ import Ġkotlinx . coroutines . test . set Main Ċ import Ġorg . junit . jupiter . api . After Each Ċ import Ġorg . junit . jupiter . api . BeforeEach Ċ Ċ @ Use Experimental ( Experimental Cor outines Api :: class ) Ċ abstract Ġclass ĠBaseTest With MainThread Ġ{ ĊĊĠĠĠ Ġprotected Ġval Ġdispatcher Ġ= ĠTest Coroutine Dispatcher () ĊĊĠĠĠ Ġ@ BeforeEach ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ ĠDispatch ers . set Main ( dispatcher ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ After Each ĊĠĠĠ Ġfun ĠtearDown () Ġ{ ĊĠĠĠĠĠĠĠ ĠDispatch ers . reset Main () ĊĠĠĠĠĠĠĠ Ġdispatcher . cleanup Test Cor outines () ĊĠĠĠ Ġ} Ċ } Ċ