package Ġsearch box Ċ Ċ import Ġandroid . os . Build Ċ import Ġandroid . widget . Auto Complete TextView Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 Ċ import Ġandroidx . test . filters . Small Test Ċ import Ġapplication Context Ċ import Ġcom . alg ol ia . instant search . core . search box . Search Box ViewModel Ċ import Ġcom . alg ol ia . instant search . core . search box . connect View Ċ import Ġcom . alg ol ia . instant search . helper . android . search box . Search Box Auto Complete TextView Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . ro bo lectric . annotation . Config Ċ import Ġshould Equal ĊĊ Ċ @ Small Test Ċ @ Config ( sdk Ġ= Ġ[ Build . VERSION _ CODES . P ]) Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠTest Search Box Auto Complete TextView Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġtext Ġ= Ġ" text " ĊĊĠĠĠ Ġprivate Ġfun Ġview () Ġ= ĠSearch Box Auto Complete TextView ( Auto Complete TextView ( application Context )) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġconnect Should Update Text () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġview Ġ= Ġview () ĊĠĠĠĠĠĠĠ Ġval ĠviewModel Ġ= ĠSearch Box ViewModel () ĊĠĠĠĠĠĠĠ Ġval Ġconnection Ġ= ĠviewModel . connect View ( view ) ĊĊĠĠĠĠĠĠĠ ĠviewModel . query . value Ġ= Ġtext ĊĠĠĠĠĠĠĠ Ġconnection . connect () ĊĠĠĠĠĠĠĠ Ġview . auto Complete TextView . text . toString () Ġshould Equal Ġtext ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġon TextChanged Should Update Item () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġview Ġ= Ġview () ĊĠĠĠĠĠĠĠ Ġval ĠviewModel Ġ= ĠSearch Box ViewModel () ĊĠĠĠĠĠĠĠ Ġval Ġconnection Ġ= ĠviewModel . connect View ( view ) ĊĊĠĠĠĠĠĠĠ Ġconnection . connect () ĊĠĠĠĠĠĠĠ Ġview . auto Complete TextView . setText ( text ) ĊĠĠĠĠĠĠĠ ĠviewModel . query . value Ġshould Equal Ġtext ĊĠĠĠ Ġ} Ċ }