package Ġcom . kh me len ko . lab . var is Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . res . Asset Manager Ċ import Ġandroid . content . res . Resources Ċ import Ġcom . kh me len ko . lab . var is . util . Assets Utils Ċ import Ġcom . n ha ar man . mockito _ kotlin . wh enever Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . mockito . Mockito . mock Ċ import Ġorg . mockito . Mockito . verify Ċ import Ġorg . ro bo lectric . Ro bo lectric TestRunner Ċ import Ġorg . ro bo lectric . annotation . Config Ċ import Ġjava . io . IOException Ċ import Ġjava . io . InputStream Ċ Ċ /** Ċ Ġ* ĠTesting ĠAssets Utils Ġclass Ċ Ġ* Ċ Ġ* Ġ@ author ĠD my tro ĠK h me len ko Ġ( d . kh me len ko @ gmail . com ) Ċ Ġ*/ Ċ @ RunWith ( Ro bo lectric TestRunner :: class ) Ċ @ Config ( constants Ġ= ĠBuild Config :: class , Ġsdk Ġ= Ġ[ 2 1 ]) Ċ class ĠTest Assets Utils Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun ĠtestGet Properties () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġproperty Ġ= Ġ" test " ĊĊĠĠĠĠĠĠĠ Ġval Ġcontext Ġ= Ġmock ( Context :: class . java ) ĊĠĠĠĠĠĠĠ Ġval Ġresources Ġ= Ġmock ( Resources :: class . java ) ĊĠĠĠĠĠĠĠ Ġval Ġasset Manager Ġ= Ġmock ( Asset Manager :: class . java ) ĊĠĠĠĠĠĠĠ Ġval ĠinputStream Ġ= Ġmock ( InputStream :: class . java ) ĊĠĠĠĠĠĠĠ Ġwhenever ( context . resources ). thenReturn ( resources ) ĊĠĠĠĠĠĠĠ Ġwhenever ( resources . assets ). thenReturn ( asset Manager ) ĊĠĠĠĠĠĠĠ Ġwhenever ( asset Manager . open ( property )). thenReturn ( inputStream ) ĊĊĠĠĠĠĠĠĠ ĠAssets Utils . getProperties ( property , Ġcontext ) ĊĊĠĠĠĠĠĠĠ Ġverify ( context ). resources ĊĠĠĠĠĠĠĠ Ġverify ( resources ). assets ĊĠĠĠĠĠĠĠ Ġverify ( asset Manager ). open ( property ) ĊĠĠĠ Ġ} Ċ } Ċ