package Ġorg . simple . clin ic . drug s . selection . custom Ċ Ċ import Ġcom . spotify . mob ius . test . First Matchers . has Effects Ċ import Ġcom . spotify . mob ius . test . First Matchers . has Model Ċ import Ġcom . spotify . mob ius . test . Init Spec Ċ import Ġcom . spotify . mob ius . test . Init Spec . assertThat First Ċ import Ġorg . junit . Test Ċ import Ġjava . util . UUID Ċ Ċ class ĠCustom Dr ug Entry Init Test Ġ{ ĊĠ Ġprivate Ġval Ġinit Spec Ġ= ĠInit Spec ( Custom Dr ug Entry Init ()) ĊĠ Ġprivate Ġval Ġdrug Name Ġ= Ġ" Am lo dip ine " ĊĠ Ġprivate Ġval Ġdos age Placeholder Ġ= Ġ" mg " ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` when Ġsheet Ġis Ġcreated Ġin Ġcreate Ġmode Ġfrom Ġthe Ġdrug Ġlist , Ġfetch Ġdrug Ġfrom Ġthe Ġdrug Uuid , Ġload Ġdrug Ġfrequency Ġchoice Ġitems Ġand Ġset Ġthe Ġscreen Ġin Ġprogress Ġstate `() Ġ{ ĊĠĠĠ Ġval Ġdrug Uuid Ġ= ĠUUID . fromString (" 6 1 0 6 5 4 4 f - 2 b 1 8 - 4 1 0 d - 9 9 2 b - 8 1 8 6 0 a 0 8 f 0 2 a ") ĊĠĠĠ Ġval Ġmodel Ġ= ĠCustom Dr ug Entry Model . default ( open As Ġ= ĠOpen As . New . From Dr ug List ( drug Uuid ), Ġdos age Placeholder ) ĊĊĠĠĠ Ġinit Spec ĊĠĠĠĠĠĠĠ Ġ. when Init ( model ) ĊĠĠĠĠĠĠĠ Ġ. then ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat First ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Model ( model . drug Info Progress State Loading ()), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Effects ( Fetch Dr ug ( drug Uuid ), ĠLoad Dr ug Frequency Choice Items ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` when Ġsheet Ġis Ġcreated Ġin Ġcreate Ġmode Ġfrom Ġa Ġdrug Ġname , Ġthen Ġupdate Ġthe Ġdrug Ġname Ġin Ġthe Ġmodel , Ġload Ġdrug Ġfrequency Ġchoice Ġitems Ġand Ġset Ġthe Ġprogress Ġstate Ġto Ġdone `() Ġ{ ĊĠĠĠ Ġval Ġmodel Ġ= ĠCustom Dr ug Entry Model . default ( open As Ġ= ĠOpen As . New . From Dr ug Name ( drug Name ), Ġdos age Placeholder ) ĊĊĠĠĠ Ġinit Spec ĊĠĠĠĠĠĠĠ Ġ. when Init ( model ) ĊĠĠĠĠĠĠĠ Ġ. then ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat First ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Model ( model . drug Name Loaded ( drug Name ). drug Info Progress State Loaded ()), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Effects ( Load Dr ug Frequency Choice Items ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` when Ġsheet Ġis Ġcreated Ġin Ġupdate Ġmode , Ġthen Ġfetch Ġpre scription , Ġload Ġdrug Ġfrequency Ġchoice Ġitems Ġand Ġset Ġthe Ġscreen Ġto Ġprogress Ġstate `() Ġ{ ĊĠĠĠ Ġval Ġpre scribed Dr ug Uuid Ġ= ĠUUID . fromString (" e 0 4 6 a 6 4 9 - dfc 0 - 4 5 b 5 - 8 9 d 4 - 7 a 4 b 0 af 1 c 2 8 2 ") ĊĠĠĠ Ġval Ġmodel Ġ= ĠCustom Dr ug Entry Model . default ( open As Ġ= ĠOpen As . Update ( pre scribed Dr ug Uuid Ġ= Ġpre scribed Dr ug Uuid ), Ġdos age Placeholder ) ĊĊĠĠĠ Ġinit Spec ĊĠĠĠĠĠĠĠ Ġ. when Init ( model ) ĊĠĠĠĠĠĠĠ Ġ. then ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat First ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Model ( model . drug Info Progress State Loading ()), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġhas Effects ( Fetch Pre scription ( pre scribed Dr ug Uuid ), ĠLoad Dr ug Frequency Choice Items ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠ Ġ} Ċ } Ċ