/* Ċ Ġ* ĠDesign ed Ġand Ġdeveloped Ġby Ġ 2 0 2 0 Ġsky do ves Ġ( Ja ew o ong ĠE um ) Ċ Ġ* Ċ Ġ* Ġ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 . sky do ves . bundler Ċ Ċ import Ġandroid . content . Component Name Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroid . net . Uri Ċ import Ġandroidx . test . core . app . Application Provider Ċ import Ġcom . sky do ves . bundler . data . Post er Ċ import Ġcom . sky do ves . bundler . data . UserInfo Ċ import Ġorg . hamcrest . Matcher Assert . assertThat Ċ import Ġorg . hamcrest . core . Is .` is ` Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . ro bo lectric . Ro bo lectric TestRunner Ċ import Ġorg . ro bo lectric . annotation . Config Ċ Ċ @ Config ( sdk Ġ= Ġ[ 2 1 ]) Ċ @ RunWith ( Ro bo lectric TestRunner :: class ) Ċ class ĠIntent Of Test Ġ{ ĊĊĠ Ġprivate Ġval Ġposter Ġ= ĠPost er . create () ĊĠ Ġprivate Ġval ĠuserInfo Ġ= ĠUserInfo . create () ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġintent Of Test () Ġ{ ĊĠĠĠ Ġval Ġintent Ġ= Ġintent Of Ġ{ ĊĠĠĠĠĠ Ġput Extra (" id ", ĠuserInfo . id ) ĊĠĠĠĠĠ Ġput Extra (" name ", ĠuserInfo . nickname ) ĊĠĠĠĠĠ Ġput Extra (" position ", ĠuserInfo . position ) ĊĠĠĠĠĠ Ġput Extra (" poster ", Ġposter ) ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( intent . getLong Extra (" id ", Ġ- 1 ), Ġ` is `( 1 0 0 0 L )) ĊĠĠĠ ĠassertThat ( intent . getString Extra (" name "), Ġ` is ` (" sky do ves ")) ĊĠĠĠ ĠassertThat ( intent . getString Extra (" position "), Ġ` is ` (" Android ")) ĊĠĠĠ ĠassertThat ( intent . get Parcelable Extra (" poster "), Ġ` is `( poster )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġintent Of From Intent Test () Ġ{ ĊĠĠĠ Ġval Ġinitial Intent Ġ= ĠIntent (). apply Ġ{ ĊĠĠĠĠĠ Ġput Extra (" id ", ĠuserInfo . id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġintent Ġ= Ġinitial Intent . intent Of Ġ{ ĊĠĠĠĠĠ Ġput Extra (" name ", ĠuserInfo . nickname ) ĊĠĠĠĠĠ Ġput Extra (" position ", ĠuserInfo . position ) ĊĠĠĠĠĠ Ġput Extra (" poster ", Ġposter ) ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( intent . getLong Extra (" id ", Ġ- 1 ), Ġ` is `( 1 0 0 0 L )) ĊĠĠĠ ĠassertThat ( intent . getString Extra (" name "), Ġ` is ` (" sky do ves ")) ĊĠĠĠ ĠassertThat ( intent . getString Extra (" position "), Ġ` is ` (" Android ")) ĊĠĠĠ ĠassertThat ( intent . get Parcelable Extra (" poster "), Ġ` is `( poster )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġintent Of From Action Test () Ġ{ ĊĠĠĠ Ġval Ġintent Ġ= ĠIntent . ACTION _ MAIN . intent Of Ġ{ ĊĠĠĠĠĠ Ġput Extra (" id ", ĠuserInfo . id ) ĊĠĠĠĠĠ Ġput Extra (" name ", ĠuserInfo . nickname ) ĊĠĠĠĠĠ Ġput Extra (" position ", ĠuserInfo . position ) ĊĠĠĠĠĠ Ġput Extra (" poster ", Ġposter ) ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( intent . action , Ġ` is `( Intent . ACTION _ MAIN )) ĊĠĠĠ ĠassertThat ( intent . getLong Extra (" id ", Ġ- 1 ), Ġ` is `( 1 0 0 0 L )) ĊĊĠĠĠ ĠassertThat ( intent . getString Extra (" name "), Ġ` is ` (" sky do ves ")) ĊĠĠĠ ĠassertThat ( intent . getString Extra (" position "), Ġ` is ` (" Android ")) ĊĠĠĠ ĠassertThat ( intent . get Parcelable Extra (" poster "), Ġ` is `( poster )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġintent Of From Action WithData Test () Ġ{ ĊĠĠĠ Ġval Ġintent Ġ= ĠIntent . ACTION _ MAIN . intent Of ( Uri . parse (" sky do ves ")) Ġ{ ĊĠĠĠĠĠ Ġput Extra (" id ", ĠuserInfo . id ) ĊĠĠĠĠĠ Ġput Extra (" name ", ĠuserInfo . nickname ) ĊĠĠĠĠĠ Ġput Extra (" position ", ĠuserInfo . position ) ĊĠĠĠĠĠ Ġput Extra (" poster ", Ġposter ) ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( intent . action , Ġ` is `( Intent . ACTION _ MAIN )) ĊĠĠĠ ĠassertThat ( intent . data , Ġ` is `( Uri . parse (" sky do ves "))) ĊĊĠĠĠ ĠassertThat ( intent . getLong Extra (" id ", Ġ- 1 ), Ġ` is `( 1 0 0 0 L )) ĊĠĠĠ ĠassertThat ( intent . getString Extra (" name "), Ġ` is ` (" sky do ves ")) ĊĠĠĠ ĠassertThat ( intent . getString Extra (" position "), Ġ` is ` (" Android ")) ĊĠĠĠ ĠassertThat ( intent . get Parcelable Extra (" poster "), Ġ` is `( poster )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġintent Of From Context Test () Ġ{ ĊĠĠĠ Ġval Ġcontext Ġ= ĠApplication Provider . getApplicationContext < Context >() ĊĠĠĠ Ġval Ġintent Ġ= Ġcontext . intent Of < Test Activity > Ġ{ ĊĠĠĠĠĠ Ġput Extra (" id ", ĠuserInfo . id ) ĊĠĠĠĠĠ Ġput Extra (" name ", ĠuserInfo . nickname ) ĊĠĠĠĠĠ Ġput Extra (" position ", ĠuserInfo . position ) ĊĠĠĠĠĠ Ġput Extra (" poster ", Ġposter ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġcomponent Name Ġ= ĠComponent Name ( context , ĠTest Activity :: class . java ) ĊĠĠĠ ĠassertThat ( intent . component ?. className , Ġ` is `( component Name . className )) ĊĠĠĠ ĠassertThat ( intent . component ?. packageName , Ġ` is `( component Name . packageName )) ĊĊĠĠĠ ĠassertThat ( intent . getLong Extra (" id ", Ġ- 1 ), Ġ` is `( 1 0 0 0 L )) ĊĠĠĠ ĠassertThat ( intent . getString Extra (" name "), Ġ` is ` (" sky do ves ")) ĊĠĠĠ ĠassertThat ( intent . getString Extra (" position "), Ġ` is ` (" Android ")) ĊĠĠĠ ĠassertThat ( intent . get Parcelable Extra (" poster "), Ġ` is `( poster )) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġintent Of From Context With Action And Uri Test () Ġ{ ĊĠĠĠ Ġval Ġcontext Ġ= ĠApplication Provider . getApplicationContext < Context >() ĊĠĠĠ Ġval Ġintent Ġ= Ġcontext . intent Of < Test Activity >( ĊĠĠĠĠĠ Ġaction Ġ= ĠIntent . ACTION _ MAIN , ĊĠĠĠĠĠ Ġuri Ġ= ĠUri . parse (" sky do ves ") ĊĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠ Ġput Extra (" id ", ĠuserInfo . id ) ĊĠĠĠĠĠ Ġput Extra (" name ", ĠuserInfo . nickname ) ĊĠĠĠĠĠ Ġput Extra (" position ", ĠuserInfo . position ) ĊĠĠĠĠĠ Ġput Extra (" poster ", Ġposter ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġcomponent Name Ġ= ĠComponent Name ( context , ĠTest Activity :: class . java ) ĊĠĠĠ ĠassertThat ( intent . component ?. className , Ġ` is `( component Name . className )) ĊĠĠĠ ĠassertThat ( intent . component ?. packageName , Ġ` is `( component Name . packageName )) ĊĊĠĠĠ ĠassertThat ( intent . action , Ġ` is `( Intent . ACTION _ MAIN )) ĊĠĠĠ ĠassertThat ( intent . data , Ġ` is `( Uri . parse (" sky do ves "))) ĊĊĠĠĠ ĠassertThat ( intent . getLong Extra (" id ", Ġ- 1 ), Ġ` is `( 1 0 0 0 L )) ĊĠĠĠ ĠassertThat ( intent . getString Extra (" name "), Ġ` is ` (" sky do ves ")) ĊĠĠĠ ĠassertThat ( intent . getString Extra (" position "), Ġ` is ` (" Android ")) ĊĠĠĠ ĠassertThat ( intent . get Parcelable Extra (" poster "), Ġ` is `( poster )) ĊĠ Ġ} Ċ } Ċ