package Ġcom . daf ian . android . drag oon ers . remote . source Ċ Ċ import Ġcom . daf ian . android . drag oon ers . remote . service . Rest Service Ċ import Ġcom . daf ian . android . drag oon ers . util . TestData Factory Ċ import Ġkotlinx . coroutines . Comp letable Deferred Ċ import Ġkotlinx . coroutines . run Blocking Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Test Ċ import Ġorg . mockito . Mockito Ċ import Ġorg . mockito . Mockito .` when ` Ċ Ċ class ĠCh arm Remote DataSource Impl Test Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġservice Ġ= ĠMockito . mock ( Rest Service :: class . java ) ĊĊĠĠĠ Ġprivate Ġval ĠdataSource Ġ= ĠCh arm Remote DataSource Impl ( service ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Char m All _ with Success () Ġ= Ġrun Blocking Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġmock Char m List Ġ= ĠTest Data Factory . make Data Char m List () ĊĊĠĠĠĠĠĠĠ Ġ` when `( service . get Char m All ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. thenReturn ( Comp letable Deferred ( mock Char m List )) ĊĊĠĠĠĠĠĠĠ Ġval Ġresult List Ġ= ĠdataSource . get Char m All (). await () ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( result List , Ġmock Char m List ) ĊĠĠĠ Ġ} Ċ }