package Ġorg . simple . clin ic . drug s . selection . entry . confirm removed ialog Ċ Ċ import Ġcom . n ha ar man . mockito _ kotlin . mock Ċ import Ġcom . n ha ar man . mockito _ kotlin . verify Ċ import Ġcom . n ha ar man . mockito _ kotlin . wh enever Ċ import Ġio . reactivex . Comp letable Ċ import Ġio . reactivex . subjects . Publish Subject Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . simple . clin ic . bp . entry . confirm remove blood pressure . Confirm Remove Pre scription Dialog Created Ċ import Ġorg . simple . clin ic . bp . entry . confirm remove blood pressure . Remove Pre scription Clicked Ċ import Ġorg . simple . clin ic . drug s . Pre scription Repository Ċ import Ġorg . simple . clin ic . util . Rx Errors Rule Ċ import Ġorg . simple . clin ic . widgets . Ui Event Ċ import Ġjava . util . UUID Ċ Ċ class ĠConfirm Remove Pre scription Dialog Controller Test Ġ{ ĊĊĠ Ġ@ get : Rule ĊĠ Ġval Ġrx Errors Rule Ġ= ĠRx Errors Rule () ĊĊĠ Ġprivate Ġval Ġpre scription Repository Ġ= Ġmock < Pre scription Repository >() ĊĠ Ġprivate Ġval Ġdialog Ġ= Ġmock < Confirm Remove Pre scription Dialog >() ĊĠ Ġlateinit Ġvar Ġcontroller : ĠConfirm Remove Pre scription Dialog Controller ĊĊĠ Ġprivate Ġval Ġui Events Ġ= ĠPublish Subject . create < Ui Event >() ĊĊĠ Ġprivate Ġval Ġpre scribed Dr ug Uuid Ġ= ĠUUID . randomUUID () ĊĊĠ Ġ@ Before ĊĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠ Ġcontroller Ġ= ĠConfirm Remove Pre scription Dialog Controller ( pre scription Repository ) ĊĠĠĠ Ġui Events ĊĠĠĠĠĠĠĠ Ġ. compose ( controller ) ĊĠĠĠĠĠĠĠ Ġ. subscribe Ġ{ Ġui Change Ġ-> Ġui Change ( dialog ) Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` when Ġremove Ġis Ġclicked , Ġthen Ġdelete Ġpre scription `() Ġ{ ĊĠĠĠ Ġwhenever ( pre scription Repository . soft Delete Pre scription ( pre scribed Dr ug Uuid )). thenReturn ( Comp letable . complete ()) ĊĊĠĠĠ Ġui Events . onNext ( Confirm Remove Pre scription Dialog Created ( pre scribed Dr ug Uuid )) ĊĠĠĠ Ġui Events . onNext ( Remove Pre scription Clicked ) ĊĊĠĠĠ Ġverify ( pre scription Repository ). soft Delete Pre scription ( pre scribed Dr ug Uuid ) ĊĠĠĠ Ġverify ( dialog ). dismiss () ĊĠ Ġ} Ċ Ċ } Ċ