package Ġorg . simple . clin ic . summary . tele consult ation . sync Ċ Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġorg . junit . After Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . rules . Rule Chain Ċ import Ġorg . simple . clin ic . Test Clin ic App Ċ import Ġorg . simple . clin ic . TestData Ċ import Ġorg . simple . clin ic . rules . Save Database Rule Ċ import Ġorg . simple . clin ic . util . Rules Ċ import Ġjava . util . UUID Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠTele consult ation Facility Repository Android Test Ġ{ ĊĊĠ Ġ@ Inject ĊĠ Ġlateinit Ġvar Ġrepository : ĠTele consult ation Facility Repository ĊĊĠ Ġ@ get : Rule ĊĠ Ġval Ġrules : ĠRule Chain Ġ= ĠRules ĊĠĠĠĠĠ Ġ. global () ĊĠĠĠĠĠ Ġ. around ( Save Database Rule ()) ĊĊĠ Ġ@ Before ĊĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠ ĠTest Clin ic App . app Component (). inject ( this ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġsaving _ records _ should _ work _ correct ly () Ġ{ ĊĠĠĠ Ġ// Ġgiven ĊĠĠĠ Ġval Ġfacility 1 Ġ= ĠUUID . fromString (" 2 8 6 6 eef 6 - f 7 c 5 - 4 0 2 c - b 4 5 3 - dc 5 5 b 9 ee abe 1 ") ĊĠĠĠ Ġval Ġfacility 2 Ġ= ĠUUID . fromString (" 3 d 6 9 ae 6 c - 6 0 fd - 4 d 7 9 - 8 5 3 3 - 4 c 4 f 7 bce 8 0 a 4 ") ĊĠĠĠ Ġval Ġfacility 3 Ġ= ĠUUID . fromString (" fd 4 f 4 3 9 f - 4 b 1 b - 4 0 fa - b 3 d 3 - 8 6 e 7 3 2 2 c 7 bae ") ĊĊĠĠĠ Ġval Ġmedical Off icer 1 Ġ= ĠTest Data . medical Off icer ( ĊĠĠĠĠĠĠĠ Ġid Ġ= ĠUUID . fromString (" 9 c 9 eac 7 5 - ce 6 7 - 4 f 8 3 - 9 5 4 4 - 1 be 1 1 7 9 5 8 3 2 9 "), ĊĠĠĠĠĠĠĠ ĠfullName Ġ= Ġ" Dr ĠSun il ĠD har ", ĊĠĠĠĠĠĠĠ ĠphoneNumber Ġ= Ġ" 1 1 1 1 1 1 1 1 1 1 " ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġmedical Off icer 2 Ġ= ĠTest Data . medical Off icer ( ĊĠĠĠĠĠĠĠ Ġid Ġ= ĠUUID . fromString (" d 4 f 3 3 eef - c 5 e 6 - 4 0 2 c - b 8 c 1 - 8 c 3 f 7 9 8 b 5 ff 0 "), ĊĠĠĠĠĠĠĠ ĠfullName Ġ= Ġ" Dr ĠAb his he k ĠAr ora ", ĊĠĠĠĠĠĠĠ ĠphoneNumber Ġ= Ġ" 2 2 2 2 2 2 2 2 2 2 " ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġtele consult ation Facility 1 Ġ= ĠTest Data . tele consult ation Facility Info ( ĊĠĠĠĠĠĠĠ Ġid Ġ= Ġfacility 1 , ĊĠĠĠĠĠĠĠ Ġfacility Id Ġ= Ġfacility 1 ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġtele consult ation Facility 2 Ġ= ĠTest Data . tele consult ation Facility Info ( ĊĠĠĠĠĠĠĠ Ġid Ġ= Ġfacility 2 , ĊĠĠĠĠĠĠĠ Ġfacility Id Ġ= Ġfacility 2 ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġtele consult ation Facility 3 Ġ= ĠTest Data . tele consult ation Facility Info ( ĊĠĠĠĠĠĠĠ Ġid Ġ= Ġfacility 3 , ĊĠĠĠĠĠĠĠ Ġfacility Id Ġ= Ġfacility 3 ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġtele consult ation Facility With Medical Off ic ers Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠ ĠTest Data . tele consult ation Facility With Medical Off ic ers ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtele consult ation Facility Info Ġ= Ġtele consult ation Facility 1 , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmedical Off ic ers Ġ= ĠlistOf ( medical Off icer 1 , Ġmedical Off icer 2 ) ĊĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠ ĠTest Data . tele consult ation Facility With Medical Off ic ers ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtele consult ation Facility Info Ġ= Ġtele consult ation Facility 2 , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmedical Off ic ers Ġ= ĠlistOf ( medical Off icer 1 ) ĊĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠ ĠTest Data . tele consult ation Facility With Medical Off ic ers ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtele consult ation Facility Info Ġ= Ġtele consult ation Facility 3 , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmedical Off ic ers Ġ= Ġempty List () ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġrepository . save ( tele consult ation Facility With Medical Off ic ers ) ĊĊĠĠĠ Ġ// Ġwhen ĊĠĠĠ Ġval Ġtele consult ation Fac ilities Ġ= Ġrepository . getAll () ĊĊĠĠĠ Ġ// Ġthen ĊĠĠĠ ĠassertThat ( tele consult ation Fac ilities ). isEqualTo ( tele consult ation Facility With Medical Off ic ers ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġgetting _ medical _ off ic ers _ should _ work _ correct ly () Ġ{ ĊĠĠĠ Ġ// Ġgiven ĊĠĠĠ Ġval Ġfacility 1 Ġ= ĠUUID . fromString (" 2 8 6 6 eef 6 - f 7 c 5 - 4 0 2 c - b 4 5 3 - dc 5 5 b 9 ee abe 1 ") ĊĠĠĠ Ġval Ġfacility 2 Ġ= ĠUUID . fromString (" 3 d 6 9 ae 6 c - 6 0 fd - 4 d 7 9 - 8 5 3 3 - 4 c 4 f 7 bce 8 0 a 4 ") ĊĠĠĠ Ġval Ġfacility 3 Ġ= ĠUUID . fromString (" fd 4 f 4 3 9 f - 4 b 1 b - 4 0 fa - b 3 d 3 - 8 6 e 7 3 2 2 c 7 bae ") ĊĊĠĠĠ Ġval Ġmedical Off icer 1 Ġ= ĠTest Data . medical Off icer ( ĊĠĠĠĠĠĠĠ Ġid Ġ= ĠUUID . fromString (" 8 bc fa 8 6 4 - 2 4 4 1 - 4 0 a 4 - 8 7 cf - b 0 f 3 8 4 7 4 3 3 ee "), ĊĠĠĠĠĠĠĠ ĠfullName Ġ= Ġ" Dr ĠSun il ĠD har ", ĊĠĠĠĠĠĠĠ ĠphoneNumber Ġ= Ġ" 1 1 1 1 1 1 1 1 1 1 " ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġmedical Off icer 2 Ġ= ĠTest Data . medical Off icer ( ĊĠĠĠĠĠĠĠ Ġid Ġ= ĠUUID . fromString (" d 4 f 3 3 eef - c 5 e 6 - 4 0 2 c - b 8 c 1 - 8 c 3 f 7 9 8 b 5 ff 0 "), ĊĠĠĠĠĠĠĠ ĠfullName Ġ= Ġ" Dr ĠAb his he k ĠAr ora ", ĊĠĠĠĠĠĠĠ ĠphoneNumber Ġ= Ġ" 2 2 2 2 2 2 2 2 2 2 " ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġtele consult ation Facility 1 Ġ= ĠTest Data . tele consult ation Facility Info ( ĊĠĠĠĠĠĠĠ Ġid Ġ= Ġfacility 1 , ĊĠĠĠĠĠĠĠ Ġfacility Id Ġ= Ġfacility 1 ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġtele consult ation Facility 2 Ġ= ĠTest Data . tele consult ation Facility Info ( ĊĠĠĠĠĠĠĠ Ġid Ġ= Ġfacility 2 , ĊĠĠĠĠĠĠĠ Ġfacility Id Ġ= Ġfacility 2 ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġtele consult ation Facility 3 Ġ= ĠTest Data . tele consult ation Facility Info ( ĊĠĠĠĠĠĠĠ Ġid Ġ= Ġfacility 3 , ĊĠĠĠĠĠĠĠ Ġfacility Id Ġ= Ġfacility 3 ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġtele consult ation Facility With Medical Off ic ers Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠ ĠTest Data . tele consult ation Facility With Medical Off ic ers ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtele consult ation Facility Info Ġ= Ġtele consult ation Facility 1 , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmedical Off ic ers Ġ= ĠlistOf ( medical Off icer 1 , Ġmedical Off icer 2 ) ĊĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠ ĠTest Data . tele consult ation Facility With Medical Off ic ers ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtele consult ation Facility Info Ġ= Ġtele consult ation Facility 2 , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmedical Off ic ers Ġ= ĠlistOf ( medical Off icer 1 ) ĊĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠ ĠTest Data . tele consult ation Facility With Medical Off ic ers ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtele consult ation Facility Info Ġ= Ġtele consult ation Facility 3 , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmedical Off ic ers Ġ= Ġempty List () ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġrepository . save ( tele consult ation Facility With Medical Off ic ers ) ĊĊĠĠĠ Ġ// Ġwhen ĊĠĠĠ Ġval Ġmedical Off ic ers Ġ= Ġrepository . medical Off ic ers For Facility ( facility 1 ) ĊĊĠĠĠ Ġ// Ġthen ĊĠĠĠ ĠassertThat ( medical Off ic ers ). isEqualTo ( listOf ( medical Off icer 1 , Ġmedical Off icer 2 )) ĊĠ Ġ} Ċ } Ċ