package Ġcontroller Ċ Ċ import Ġcom . ark iv an ov . mv ik otlin . core . lifecycle . Lifecycle Ċ import Ġcom . ark iv an ov . mv ik otlin . core . lifecycle . Lifecycle Registry Ċ import Ġcom . ark iv an ov . mv ik otlin . core . store . Store Factory Ċ import Ġcom . ark iv an ov . mv ik otlin . main . store . Default Store Factory Ċ import Ġcom . bad oo . reak t ive . scheduler . override Schedulers Ċ import Ġcom . bad oo . reak t ive . test . scheduler . Test Scheduler Ċ import Ġcom . bad oo . reak t ive . utils . reak t ive Un caught ErrorHandler Ċ import Ġcom . bad oo . reak t ive . utils . reset Re akt ive Un caught ErrorHandler Ċ import Ġmodel . Cut Ċ import Ġmodel . Research Ċ import Ġresume Ċ import Ġtest Cut Ċ import Ġtest Research Ċ import Ġview . Slider View Ċ import Ġview . Test Slider View Ċ import Ġkotlin . test .* Ċ Ċ class ĠSlider Controller Test Ġ{ ĊĊĠ Ġprivate Ġval Ġlifecycle Ġ= ĠLifecycle Registry () ĊĠ Ġprivate Ġval Ġoutput Ġ= ĠArrayList < Slider Controller . Output >() ĊĊĠ Ġprivate Ġval Ġdependencies Ġ= ĊĠĠĠ Ġobject Ġ: ĠSlider Controller . Dependencies Ġ{ ĊĠĠĠĠĠ Ġoverride Ġval Ġstore Factory : ĠStore Factory Ġ= ĠDefault Store Factory ĊĠĠĠĠĠ Ġoverride Ġval Ġlifecycle : ĠLifecycle Ġ= Ġthis @ Slider Controller Test . lifecycle ĊĠĠĠĠĠ Ġoverride Ġval Ġcut : ĠCut Ġ= Ġtest Cut ĊĠĠĠĠĠ Ġoverride Ġval Ġresearch : ĠResearch Ġ= Ġtest Research ĊĠĠĠĠĠ Ġoverride Ġval Ġslider Output : Ġ( Slider Controller . Output ) Ġ-> ĠUnit Ġ= Ġ{ Ġoutput Ġ+= Ġit Ġ} ĊĠĠĠ Ġ} ĊĊĠ Ġprivate Ġval Ġslider View Ġ= ĠTest Slider View () ĊĠ Ġprivate Ġlateinit Ġvar Ġcontroller : ĠSlider Controller ĊĊĠ Ġ@ Before Test ĊĠ Ġfun Ġbefore () Ġ{ ĊĠĠĠ Ġoverride Schedulers ( main Ġ= Ġ{ ĠTest Scheduler () Ġ}, Ġio Ġ= Ġ{ ĠTest Scheduler () Ġ}) ĊĠĠĠ Ġre akt ive Un caught ErrorHandler Ġ= Ġ{ Ġthrow Ġit Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ After Test ĊĠ Ġfun Ġafter () Ġ{ ĊĠĠĠ Ġreset Re akt ive Un caught ErrorHandler () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshows _ Slider _ Data _ WHEN _ created () Ġ{ ĊĠĠĠ Ġcreate Controller () ĊĊĠĠĠ ĠassertNotNull ( slider View . model . current Value ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshows _ middle _ slice _ number _ of _ range _ WHEN _ created () Ġ{ ĊĠĠĠ Ġcreate Controller () ĊĊĠĠĠ ĠassertEquals ( test Cut . data . n _ images Ġ/ Ġ 2 , Ġslider View . model . current Value ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshows _ max _ slice _ number _ WHEN _ created () Ġ{ ĊĠĠĠ Ġcreate Controller () ĊĊĠĠĠ ĠassertEquals ( test Cut . data . n _ images , Ġslider View . model . max Value ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġshows _ changed _ slice _ number _ WHEN _ slider _ changed () Ġ{ ĊĠĠĠ Ġcreate Controller () ĊĠĠĠ Ġval ĠnewValue Ġ= Ġslider View . model . current Value Ġ+ Ġ 1 ĊĠĠĠ Ġslider View . dispatch ( Slider View . Event . Handle OnChange ( newValue )) ĊĊĠĠĠ ĠassertEquals ( newValue , Ġslider View . model . current Value ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġcreate Controller () Ġ{ ĊĠĠĠ Ġcontroller Ġ= ĠSlider Controller Impl ( dependencies ) ĊĠĠĠ Ġcontroller . on View Created ( slider View , Ġlifecycle ) ĊĠĠĠ Ġlifecycle . resume () ĊĠ Ġ} Ċ }