package Ġcom . architect coders . ar qu itect om ar vel . fake Modules Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroidx . room . Room Ċ import Ġcom . architect coders . ar qu itect om ar vel . data . database . Mar vel Database Ċ import Ġcom . architect coders . ar qu itect om ar vel . di . App Module For Room Database Provider Ċ import Ġdagger . Module Ċ import Ġdagger . Provides Ċ import Ġdagger . h ilt . Install In Ċ import Ġdagger . h ilt . android . qual ifiers . ApplicationContext Ċ import Ġdagger . h ilt . components . Singleton Component Ċ import Ġdagger . h ilt . testing . Test Install In Ċ import Ġkotlinx . coroutines . Experimental Cor outines Api Ċ import Ġkotlinx . coroutines . as Executor Ċ import Ġkotlinx . coroutines . test . Test Coroutine Dispatcher Ċ Ċ @ Module Ċ @ Test Install In ( ĊĠĠĠ Ġcomponents Ġ= Ġ[ Singleton Component :: class ], ĊĠĠĠ Ġreplaces Ġ= Ġ[ App Module For Room Database Provider :: class ] Ċ ) Ċ object ĠUn install App Module For Room Database Provider Ċ Ċ @ Experimental Cor outines Api Ċ @ Module Ċ @ Install In ( Singleton Component :: class ) Ċ class ĠFake App Module For Room Ġ{ ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġdatabase Provider (@ ApplicationContext Ġapp Context : ĠContext ): ĠMar vel Database Ġ= ĊĠĠĠĠĠĠĠ ĠRoom . in Memory Database Builder ( app Context , ĠMar vel Database :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Query Executor ( Test Coroutine Dispatcher (). as Executor ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () Ċ } Ċ