package Ġapp . bo let inh os . welcome Ċ Ċ import Ġapp . bo let inh os . bill . add . Add Bill View Key Ċ import Ġapp . bo let inh os . navigation . View Key Ċ import Ġapp . bo let inh os . summary . Summary View Key Ċ import Ġassert k . assertThat Ċ import Ġassert k . assertions . isInstanceOf Ċ import Ġcom . zh u inden . simple stack . Back stack Ċ import Ġcom . zh u inden . simple stack . History Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ Ċ class ĠWelcome ViewModel Test Ġ{ ĊĠĠĠ Ġprivate Ġval Ġback stack : ĠBack stack Ġ= ĠBack stack () ĊĠĠĠ Ġprivate Ġval ĠviewModel : ĠWelcome ViewModel Ġ= ĠWelcome ViewModel ( back stack ) ĊĊĠĠĠ Ġ@ Before Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġback stack . set Scoped Services Ġ{ Ġ Ġ} ĊĠĠĠĠĠĠĠ Ġback stack . setup ( History . single ( Welcome View Key ())) ĊĠĠĠĠĠĠĠ Ġback stack . setState Ch anger Ġ{ Ġ_, Ġcompletion Callback Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcompletion Callback . state Change Complete () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġ` should Ġopen Ġadd Ġbill Ġscreen Ġon Ġadd Ġbill Ġclick `() Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel . on Add Bill Click () ĊĠĠĠĠĠĠĠ ĠassertThat ( back stack . top < View Key > ()). isInstanceOf ( Add Bill View Key :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġ` should Ġopen Ġsummary Ġafter Ġcreating Ġfirst Ġbill `() Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel . on Bill Created () ĊĠĠĠĠĠĠĠ ĠassertThat ( back stack . top < View Key > ()). isInstanceOf ( Summary View Key :: class ) ĊĠĠĠ Ġ} Ċ } Ċ