package Ġorg . s amar th ya . collect . android . projects Ċ Ċ import Ġandroidx . test . espress o . matcher . View Matchers . assertThat Ċ import Ġandroidx . test . ext . junit . runners . Android JUnit 4 Ċ import Ġorg . hamcrest . Matchers .` is ` Ċ import Ġorg . hamcrest . Matchers . contains Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . mockito . kotlin . mock Ċ import Ġorg . s amar th ya . collect . android . storage . Storage Path Provider Ċ import Ġorg . s amar th ya . collect . projects . In Mem Projects Repository Ċ import Ġorg . s amar th ya . collect . projects . Project Ċ import Ġorg . s amar th ya . collect . shared . Temp Files Ċ import Ġorg . s amar th ya . collect . shared . strings . UUID Generator Ċ import Ġjava . io . File Ċ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠProject Importer Test Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġprojects Repository Ġ= ĠIn Mem Projects Repository ( UUID Generator (), ) ĊĊĠĠĠ Ġprivate Ġval Ġroot Dir Ġ= ĠTemp Files . create TempDir () ĊĊĠĠĠ Ġprivate Ġval Ġstorage Path Provider Ġ= ĠStorage Path Provider ( mock (), Ġroot Dir . absolute Path ) ĊĊĠĠĠ Ġprivate Ġval Ġproject Importer Ġ= ĠProject Importer ( ĊĠĠĠĠĠĠĠ Ġstorage Path Provider , ĊĠĠĠĠĠĠĠ Ġprojects Repository ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` import New Project () Ġcreates Ġnew Ġproject `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnew Project Ġ= ĠProject . New (" Project ĠX ", Ġ" X ", Ġ"# cccccc ") ĊĠĠĠĠĠĠĠ Ġval Ġsaved Project Ġ= Ġproject Importer . import New Project ( new Project ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( projects Repository . getAll (), Ġcontains ( saved Project )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` import New Project () Ġcreates Ġstorage Ġfor Ġproject `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnew Project Ġ= ĠProject . New (" Project ĠX ", Ġ" X ", Ġ"# cccccc ") ĊĠĠĠĠĠĠĠ Ġval Ġsaved Project Ġ= Ġproject Importer . import New Project ( new Project ) ĊĊĠĠĠĠĠĠĠ Ġstorage Path Provider . getProject Dir Paths ( saved Project . uuid ). forEach Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġdir Ġ= ĠFile ( it ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( dir . exists (), Ġ` is `( true )) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( dir . isDirectory , Ġ` is `( true )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ