package Ġcom . ar ind am . cam er ax Ċ Ċ import Ġandroid . Manifest Ċ import Ġandroid . content . Context Ċ import Ġandroidx . test . core . app . Application Provider Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 Ċ import Ġandroidx . test . rule . Activity Test Rule Ċ import Ġandroidx . test . rule . Grant Permission Rule Ċ import Ġcom . ar ind am . cam er ax . ui . home . Home Activity Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ Ċ /** Ċ Ġ* ĠCreated Ġby ĠAr ind am ĠK arm ak ar Ġon Ġ 9 / 5 / 1 9 . Ċ Ġ*/ Ċ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠMain Instrument ed Test Ġ{ ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġval Ġpermission Rule : ĠGrant Permission Rule Ġ= ĠGrant Permission Rule . grant ( ĊĠĠĠĠĠĠĠ ĠManifest . permission . CAMERA /* , ĠManifest . permission . RECORD _ AUDIO */ ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġval Ġactivity Rule : ĠActivity Test Rule < Home Activity > Ġ= ĠActivity Test Rule ( Home Activity :: class . java ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġuse AppContext () Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠContext Ġof Ġthe Ġapp Ġunder Ġtest ĊĠĠĠĠĠĠĠ Ġval Ġcontext Ġ= ĠApplication Provider . getApplicationContext () Ġas ĠContext ĊĠĠĠĠĠĠĠ ĠassertEquals (" com . ar ind am . cam er ax . debug ", Ġcontext . packageName ) ĊĠĠĠ Ġ} Ċ } Ċ