package Ġcom . example . hello mv vm 5 . view model Ċ Ċ import Ġandroidx . arch . core . executor . testing . Instant Task Executor Rule Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . rules . Test Rule ĊĊ Ċ class ĠCrypt oc urrencies ViewModel Test Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġcrypt oc urrencies ViewModel : ĠCrypt oc urrencies ViewModel ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġvar Ġrule : ĠTest Rule Ġ= ĠInstant Task Executor Rule () ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠĠĠĠĠ Ġcrypt oc urrencies ViewModel Ġ= ĠCrypt oc urrencies ViewModel () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Initial () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlive Data Ġ= Ġcrypt oc urrencies ViewModel . getC rypt oc urrencies () ĊĠĠĠĠĠĠĠ ĠassertEquals ( live Data . value ! ![ 0 ] !!. name , Ġ" BIT CO IN ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Add Crypt oc urrency () Ġ{ ĊĠĠĠĠĠĠĠ Ġcrypt oc urrencies ViewModel . addTo Crypt oc urrencies (" Mon ero ", Ġ" mon ero . org ") ĊĠĠĠĠĠĠĠ Ġval Ġlive Data Ġ= Ġcrypt oc urrencies ViewModel . getC rypt oc urrencies () ĊĠĠĠĠĠĠĠ ĠassertEquals ( live Data . value ! ![ 4 ] !!. name , Ġ" MON ERO ") ĊĠĠĠ Ġ} Ċ }