/* Ċ Ġ* ĠCopyright Ġ( c ) ĠMicrosoft ĠCorporation . ĠAll Ġrights Ġreserved . Ċ Ġ* ĠLicensed Ġunder Ġthe ĠMIT ĠLicense . Ċ Ġ* Ċ Ġ*/ Ċ Ċ package Ġcom . microsoft . device . dual screen . fragment sh andler Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . core . os . bundle Of Ċ import Ġandroidx . test . filters . Medium Test Ċ import Ġandroidx . test . internal . runner . junit 4 . Android JUnit 4 Class Runner Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġcom . microsoft . device . dual screen . fragment sh andler . utils . FragmentManager State Ċ import Ġorg . junit . Fix Method Order Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . junit . runners . Method Sort ers Ċ Ċ /** Ċ Ġ* ĠTest Ġclass Ġfor ĠFragment Handler Ġlibrary Ġusing ĠAppCompat Ġversion Ġ 1 . 3 . 0 Ċ Ġ*/ Ċ @ Medium Test Ċ @ RunWith ( Android JUnit 4 Class Runner :: class ) Ċ @ Fix Method Order ( Method Sort ers . NAME _ ASC ENDING ) Ċ class ĠFragment Manager State Wrapper Test For New AppCompat Library Ġ{ ĊĠĠĠ Ġprivate Ġval Ġfragment Manager State Ġ= ĠFragment Manager State Wrapper () ĊĠĠĠ Ġprivate Ġval Ġsingle Screen Fragment State Ġ= Ġbundle Of (" android : support : fragments " Ġto ĠFragment Manager State ()) ĊĠĠĠ Ġprivate Ġval Ġdual Screen Fragment State Ġ= Ġbundle Of (" android : support : fragments " Ġto ĠFragment Manager State ()) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Swap () Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠLaunch Ġon Ġsingle Ġscreen ĊĠĠĠĠĠĠĠ Ġval Ġbundle Ġ= Ġbundle Of ( FragmentManager State Wrapper . B UNDLE _ SA VED _ STATE _ REGISTRY _ KEY Ġto Ġsingle Screen Fragment State ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠSwitch Ġto Ġdual Ġscreen ĊĠĠĠĠĠĠĠ Ġfragment Manager State . swap Single To Dual ( bundle ) ĊĠĠĠĠĠĠĠ ĠassertThat ( fragment Manager State . single Screen FragmentManager State ). isEqualTo ( single Screen Fragment State ) ĊĠĠĠĠĠĠĠ ĠassertThat ( fragment Manager State . dual Screen FragmentManager State ). isNull () ĊĠĠĠĠĠĠĠ ĠassertThat ( bundle . fragment Manager State ). isEqualTo ( null ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠSwitch Ġto Ġsingle Ġscreen ĊĠĠĠĠĠĠĠ Ġbundle . put Parcelable ( FragmentManager State Wrapper . B UNDLE _ SA VED _ STATE _ REGISTRY _ KEY , Ġdual Screen Fragment State ) ĊĠĠĠĠĠĠĠ Ġfragment Manager State . swap Dual To Single ( bundle ) ĊĠĠĠĠĠĠĠ ĠassertThat ( fragment Manager State . single Screen FragmentManager State ). isEqualTo ( single Screen Fragment State ) ĊĠĠĠĠĠĠĠ ĠassertThat ( fragment Manager State . dual Screen FragmentManager State ). isEqualTo ( dual Screen Fragment State ) ĊĠĠĠĠĠĠĠ ĠassertThat ( bundle . fragment Manager State ). isEqualTo ( single Screen Fragment State ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠSwitch Ġto Ġdual Ġscreen ĊĠĠĠĠĠĠĠ Ġfragment Manager State . swap Single To Dual ( bundle ) ĊĠĠĠĠĠĠĠ ĠassertThat ( fragment Manager State . single Screen FragmentManager State ). isEqualTo ( single Screen Fragment State ) ĊĠĠĠĠĠĠĠ ĠassertThat ( fragment Manager State . dual Screen FragmentManager State ). isEqualTo ( dual Screen Fragment State ) ĊĠĠĠĠĠĠĠ ĠassertThat ( bundle . fragment Manager State ). isEqualTo ( dual Screen Fragment State ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠSwitch Ġto Ġsingle Ġscreen ĊĠĠĠĠĠĠĠ Ġfragment Manager State . swap Dual To Single ( bundle ) ĊĠĠĠĠĠĠĠ ĠassertThat ( fragment Manager State . single Screen FragmentManager State ). isEqualTo ( single Screen Fragment State ) ĊĠĠĠĠĠĠĠ ĠassertThat ( fragment Manager State . dual Screen FragmentManager State ). isEqualTo ( dual Screen Fragment State ) ĊĠĠĠĠĠĠĠ ĠassertThat ( bundle . fragment Manager State ). isEqualTo ( single Screen Fragment State ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ private Ġval ĠBundle . fragment Manager State : ĠBundle ? ĊĠĠĠ Ġget () Ġ= Ġget Bundle ( FragmentManager State Wrapper . B UNDLE _ SA VED _ STATE _ REGISTRY _ KEY ) Ċ