package Ġh us ay nh ake em . io . un connect ify re Ċ Ċ import Ġandroid . support . annotation . String Res Ċ import Ġandroid . support . test . espress o . Esp ress o . on View Ċ import Ġandroid . support . test . espress o . assertion . View Assertions . matches Ċ import Ġandroid . support . test . espress o . matcher . View Matchers . is Displayed Ċ import Ġandroid . support . test . espress o . matcher . View Matchers . with Text Ċ import Ġandroid . support . v 7 . app . AppCompatActivity ĊĊ Ċ fun Ġassert Toast Is Displayed With Message (@ String Res Ġres Id : ĠInt , Ġactivity : ĠAppCompatActivity ) Ġ{ ĊĠĠĠ Ġon View ( with Text ( res Id )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. in Root ( Toast Matcher ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( is Displayed ())) Ċ } Ċ Ċ fun Ġassert Toast Is Displayed With Message ( text : ĠString , Ġactivity : ĠAppCompatActivity ) Ġ{ ĊĠĠĠ Ġon View ( with Text ( text )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. in Root ( Toast Matcher ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. check ( matches ( is Displayed ())) Ċ }