package Ġcom . zg . bur ger joint . instrumentation tests Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroidx . room . Room Ċ import Ġandroidx . test . core . app . Application Provider Ċ import Ġandroidx . test . internal . runner . junit 4 . Android JUnit 4 Class Runner Ċ import Ġcom . zg . bur ger joint . data . v os . Bur ger VO Ċ import Ġcom . zg . bur ger joint . persistence . Bur ger Joint Database Ċ import Ġcom . zg . bur ger joint . persistence . da os . Bur ger Dao Ċ import Ġorg . junit . After Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ @ RunWith ( Android JUnit 4 Class Runner :: class ) Ċ class ĠDatabase Test Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbur ger Dao Ġ: ĠBur ger Dao ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġdb : Bur ger Joint Database ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġcreate Db (){ ĊĠĠĠĠĠĠĠ Ġval Ġcontext Ġ= ĠApplication Provider . getApplicationContext < Context >() ĊĊĠĠĠĠĠĠĠ Ġdb = Room . in Memory Database Builder ( context ĊĠĠĠĠĠĠĠ Ġ, Bur ger Joint Database :: class . java ). build () ĊĊĠĠĠĠĠĠĠ Ġbur ger Dao = db . get Bur ger Dao () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ After ĊĠĠĠ Ġfun Ġclose Db (){ ĊĠĠĠĠĠĠĠ Ġdb . close () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġinsert Into Database Test (){ ĊĠĠĠĠĠĠĠ Ġval Ġbur ger One Ġ= ĠBur ger VO () ĊĠĠĠĠĠĠĠ Ġbur ger One . bur ger Name Ġ= Ġ" Ch icken ĠBur ger " ĊĠĠĠĠĠĠĠ Ġbur ger One . bur ger Description Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" The Ġhot Ġch icken Ġs and wich Ġor Ġsimply " ĊĠĠĠĠĠĠĠ Ġbur ger One . bur ger ImageUrl Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ"" ĊĠĠĠĠĠĠĠ Ġbur ger Dao . insert ( bur ger One ) ĊĠĠĠĠĠĠĠ Ġassert ( bur ger Dao . find Bur ger ById ( bur ger One . bur ger Id ). value ?. bur ger Id Ġ== Ġbur ger One . bur ger Id ) ĊĊĠĠĠ Ġ} Ċ Ċ }