package Ġio . github . dl le w el lyn . saf et or un . features . install origin Ċ Ċ import Ġandroid . content . Context Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġio . mock k . every Ċ import Ġio . mock k . mock k Ċ import Ġjunit . framework . TestCase Ċ Ċ internal Ġclass ĠAndroid Install Origin Strings Test Ġ: ĠTestCase () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġcontext Ġ= Ġmock k < Context >() ĊĠĠĠ Ġprivate Ġval Ġresources Ġ= ĠShared Install Origin . setup AM ock Resources () ĊĊĠĠĠ Ġprivate Ġval Ġandroid Install Origin Strings Ġ= ĠAndroid Install Origin Strings ( context ) ĊĊĠĠĠ Ġoverride Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġcontext . resources Ġ} Ġreturns Ġresources ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` test Ġmessage Ġif Ġwe Ġcant Ġfind Ġpackage `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( android Install Origin Strings . could Not Find Package ()). isEqualTo ( Shared Install Origin . NOT _ FOUND ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` test Ġmessage Ġif Ġpackage Was NotIn Allow edList `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( android Install Origin Strings . package Was In Allow edList ()). isEqualTo ( Shared Install Origin . MATCH ED ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` test Ġmessage Ġif Ġpackage Was In Allow edList `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( android Install Origin Strings . package Was NotIn Allow edList (" Ab c ")). isEqualTo ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠShared Install Origin . NOT _ MATCH ING . format ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" Ab c " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ } Ċ