/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 2 0 ĠThe ĠAndroid ĠOpen ĠSource ĠProject Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ package Ġcom . android . tools . idea . test artifacts . instrument ed . tests uite . view Ċ Ċ import Ġcom . android . tools . idea . test artifacts . instrument ed . tests uite . api . Android Test Results Ċ import Ġcom . android . tools . idea . test artifacts . instrument ed . tests uite . model . Android Device Ċ import Ġcom . android . tools . idea . test artifacts . instrument ed . tests uite . model . Android TestCase Result Ċ import Ġcom . android . tools . idea . test artifacts . instrument ed . tests uite . view . Android TestSuite Details View . Android TestSuite Details View Listener Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġcom . intellij . test Framework . Disposable Rule Ċ import Ġcom . intellij . test Framework . Ed t Rule Ċ import Ġcom . intellij . test Framework . Project Rule Ċ import Ġcom . intellij . test Framework . Runs In Ed t Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . rules . Rule Chain Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . junit . runners . JUnit 4 Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . Mockito . verify Ċ import Ġorg . mockito . Mockito Annotations Ċ import Ġjava . io . File Ċ Ċ /** Ċ Ġ* ĠUnit Ġtests Ġfor Ġ[ Android TestSuite Details View ]. Ċ Ġ*/ Ċ @ RunWith ( JUnit 4 :: class ) Ċ @ Runs In Ed t Ċ class ĠAndroid TestSuite Details View Test Ġ{ ĊĊĠ Ġprivate Ġval Ġproject Rule Ġ= ĠProject Rule () ĊĠ Ġprivate Ġval Ġdis posable Rule Ġ= ĠDis posable Rule () ĊĊĠ Ġ@ get : Rule Ġval Ġrules : ĠRule Chain Ġ= ĠRule Chain ĊĠĠĠ Ġ. outer Rule ( project Rule ) ĊĠĠĠ Ġ. around ( Ed t Rule ()) ĊĠĠĠ Ġ. around ( dis posable Rule ) ĊĊĠ Ġ@ Mock Ġlateinit Ġvar Ġmock Controller : ĠAndroid TestSuite ViewController ĊĠ Ġ@ Mock Ġlateinit Ġvar Ġmock Listener : ĠAndroid TestSuite Details View Listener ĊĊĠ Ġ@ Before ĊĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠ ĠMockito Annotations . init Mocks ( this ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġset Android Test Results Should Update Ui Components () Ġ{ ĊĠĠĠ Ġval Ġview Ġ= ĠAndroid TestSuite Details View ( dis posable Rule . dis posable , Ġmock Controller , Ġmock Listener , Ġproject Rule . project ) ĊĊĠĠĠ Ġview . set Android Test Results ( create Test Results (" method 1 ", Ġ" class 1 ", ĠAndroid TestCase Result . PAS SED )) ĊĊĠĠĠ ĠassertThat ( view . title TextView ForTesting . text ). isEqualTo (" class 1 . method 1 ") ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġclick On Close Button Should Invoke Listener () Ġ{ ĊĠĠĠ Ġval Ġview Ġ= ĠAndroid TestSuite Details View ( dis posable Rule . dis posable , Ġmock Controller , Ġmock Listener , Ġproject Rule . project ) ĊĊĠĠĠ Ġview . close Button ForTesting . do Click () ĊĊĠĠĠ Ġverify ( mock Listener ). on Android TestSuite Details View Close Button Clicked () ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġcreate Test Results ( methodName : ĠString , ĠclassName : ĠString , ĠtestCase Result : ĠAndroid TestCase Result ): ĠAndroid Test Results Ġ{ ĊĠĠĠ Ġreturn Ġobject : ĠAndroid Test Results Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun Ġget Retention Snapshot ( device : ĠAndroid Device ): ĠFile ? Ġ= Ġnull ĊĠĠĠĠĠ Ġoverride Ġval ĠmethodName : ĠString Ġ= ĠmethodName ĊĠĠĠĠĠ Ġoverride Ġval ĠclassName : ĠString Ġ= ĠclassName ĊĠĠĠĠĠ Ġoverride Ġval ĠpackageName : ĠString Ġ= Ġ"" ĊĠĠĠĠĠ Ġoverride Ġfun Ġget TestCase Result ( device : ĠAndroid Device ): ĠAndroid TestCase Result ? Ġ= ĠtestCase Result ĊĠĠĠĠĠ Ġoverride Ġfun Ġget TestResult Summary (): ĠAndroid TestCase Result Ġ= ĠtestCase Result ĊĠĠĠĠĠ Ġoverride Ġfun Ġget Log cat ( device : ĠAndroid Device ): ĠString Ġ= Ġ"" ĊĠĠĠĠĠ Ġoverride Ġfun Ġget Error StackTrace ( device : ĠAndroid Device ): ĠString Ġ= Ġ"" ĊĠĠĠĠĠ Ġoverride Ġfun Ġget Benchmark ( device : ĠAndroid Device ): ĠString Ġ= Ġ"" ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ }