package Ġcom . merc ad op ago . android . px . internal . features Ċ Ċ import Ġcom . merc ad op ago . android . px . addons . Token Device Behaviour Ċ import Ġcom . merc ad op ago . android . px . configuration . Payment Configuration Ċ import Ġcom . merc ad op ago . android . px . core . M erc ado Pago Checkout Ċ import Ġcom . merc ad op ago . android . px . core . Split Payment Processor Ċ import Ġcom . merc ad op ago . android . px . core . internal . Configuration Provider Ċ import Ġcom . merc ad op ago . android . px . model . internal . Application Ċ import Ġcom . merc ad op ago . android . px . preferences . Checkout Preference Ċ import Ġorg . junit . Assert Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . junit . Mockito JUnit Runner Ċ import Ġorg . mockito . kotlin . wh enever Ċ Ċ @ RunWith ( Mockito JUnit Runner :: class ) Ċ internal Ġclass ĠFeature Provider Test Ġ{ ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġconfiguration Provider : ĠConfiguration Provider ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġtoken Device Behaviour : ĠToken Device Behaviour ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġpayment Configuration : ĠPayment Configuration ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġsplit Payment Processor : ĠSplit Payment Processor ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġcheckout Preference : ĠCheckout Preference ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġm erc ado Pago Checkout : ĠM erc ado Pago Checkout ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( configuration Provider . payment Configuration ). thenReturn ( payment Configuration ) ĊĠĠĠĠĠĠĠ Ġwhenever ( configuration Provider . checkout Preference ). thenReturn ( checkout Preference ) ĊĠĠĠĠĠĠĠ Ġwhenever ( payment Configuration . payment Processor ). thenReturn ( split Payment Processor ) ĊĠĠĠĠĠĠĠ Ġwhenever ( merc ado Pago Checkout . payment Configuration ). thenReturn ( payment Configuration ) ĊĠĠĠĠĠĠĠ Ġwhenever ( merc ado Pago Checkout . checkout Preference ). thenReturn ( checkout Preference ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Basic Features () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcheckout Features Ġ= ĠFeature Provider Impl ( configuration Provider , Ġtoken Device Behaviour ). available Features ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( checkout Features . express ) ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( checkout Features . combo Card ) ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( checkout Features . hybrid Card ) ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( checkout Features . od r Flag ) ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( checkout Features . custom Char ges ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest When Payment Processor DoesNot Support Split _ then No Split Feature () Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( split Payment Processor . supports Split Payment ( checkout Preference )). thenReturn ( false ) ĊĠĠĠĠĠĠĠ Ġval Ġcheckout Features Ġ= ĠFeature Provider Impl ( configuration Provider , Ġtoken Device Behaviour ). available Features ĊĠĠĠĠĠĠĠ ĠAssert . assertFalse ( checkout Features . split ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest When Payment Processor Support Split _ then Split Feature () Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( split Payment Processor . supports Split Payment ( checkout Preference )). thenReturn ( true ) ĊĠĠĠĠĠĠĠ Ġval Ġcheckout Features Ġ= ĠFeature Provider Impl ( configuration Provider , Ġtoken Device Behaviour ). available Features ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( checkout Features . split ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest When Checkout Is Lazy Init And Payment Processor Support Split _ then Split Feature () Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( split Payment Processor . supports Split Payment ( checkout Preference )). thenReturn ( true ) ĊĠĠĠĠĠĠĠ Ġval Ġcheckout Features Ġ= ĠFeature Provider Impl ( merc ado Pago Checkout , Ġtoken Device Behaviour ). available Features ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( checkout Features . split ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest When Token Device Feature Is Available _ then Validation Programs Feature Contains Token Device () Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( token Device Behaviour . is Feature Available ). thenReturn ( true ) ĊĠĠĠĠĠĠĠ Ġval Ġcheckout Features Ġ= ĠFeature Provider Impl ( configuration Provider , Ġtoken Device Behaviour ). available Features ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( checkout Features . validation Programs . contains ( Application . Known Validation Program . TOKEN _ DEVICE . value )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest When Token Device Feature IsNot Available _ then Validation Programs Feature DoesNot Contains Token Device () Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( token Device Behaviour . is Feature Available ). thenReturn ( false ) ĊĠĠĠĠĠĠĠ Ġval Ġcheckout Features Ġ= ĠFeature Provider Impl ( configuration Provider , Ġtoken Device Behaviour ). available Features ĊĠĠĠĠĠĠĠ ĠAssert . assertFalse ( checkout Features . validation Programs . contains ( Application . Known Validation Program . TOKEN _ DEVICE . value )) ĊĠĠĠ Ġ} Ċ Ċ }