package Ġcom . merc ad op ago . android . px . model Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . os . Parcel Ċ import Ġandroidx . fragment . app . Dialog Fragment Ċ import Ġcom . merc ad op ago . android . px . assertEquals Ċ import Ġcom . merc ad op ago . android . px . core . Dynamic Dialog Creator Ċ import Ġcom . merc ad op ago . android . px . model . commission . Payment Type Charge Rule Ċ import Ġjunit . framework . Assert .* Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . mockito . junit . Mockito JUnit Runner Ċ import Ġjava . math . BigDecimal Ċ Ċ @ RunWith ( Mockito JUnit Runner :: class ) Ċ class ĠPayment Type Charge Rule Builder Test Ġ{ ĊĊĠĠĠ Ġ@ Test ( expected Ġ= ĠIllegalArgumentException :: class ) ĊĠĠĠ Ġfun Ġtest Builder With Zero Amount Should Throw Exception () Ġ{ ĊĠĠĠĠĠĠĠ ĠPayment Type Charge Rule . Builder ( Payment Types . ACCOUNT _ M ONE Y , ĠBigDecimal . ZERO ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Builder With Non Zero Amount Should Build Without Any Other Property () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcharge Ġ= ĠPayment Type Charge Rule . Builder ( Payment Types . ACCOUNT _ M ONE Y , ĠBigDecimal . TEN ). build () ĊĠĠĠĠĠĠĠ Ġcharge . charge (). assertEquals ( BigDecimal . TEN ) ĊĠĠĠĠĠĠĠ Ġcharge . payment TypeId . assertEquals ( Payment Types . ACCOUNT _ M ONE Y ) ĊĠĠĠĠĠĠĠ ĠassertFalse ( charge . has Detail Modal ()) ĊĠĠĠĠĠĠĠ ĠassertNull ( charge . label ) ĊĠĠĠĠĠĠĠ ĠassertNull ( charge . message ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Builder With Non Zero Amount Should Build With Tax able True As Default () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcharge Ġ= ĠPayment Type Charge Rule . Builder ( Payment Types . ACCOUNT _ M ONE Y , ĠBigDecimal . TEN ). build () ĊĠĠĠĠĠĠĠ ĠassertTrue ( charge . tax able ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Deprecated Constructor Should Have Tax able True As Default () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcharge Ġ= ĠPayment Type Charge Rule ( Payment Types . ACCOUNT _ M ONE Y , ĠBigDecimal . TEN ) ĊĠĠĠĠĠĠĠ ĠassertTrue ( charge . tax able ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Builder Set Tax able Should Set Tax able () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcharge Ġ= ĠPayment Type Charge Rule . Builder ( Payment Types . ACCOUNT _ M ONE Y , ĠBigDecimal . TEN ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Tax able ( false ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠ ĠassertFalse ( charge . tax able ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Builder Set Label Should Set Label () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcharge Ġ= ĠPayment Type Charge Rule . Builder ( Payment Types . ACCOUNT _ M ONE Y , ĠBigDecimal . TEN ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. setLabel (" Test Ġlabel ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠ ĠassertNotNull ( charge . label ) ĊĠĠĠĠĠĠĠ Ġcharge . label ?. assertEquals (" Test Ġlabel ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Builder Set Modal Should Set Modal () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcharge Ġ= ĠPayment Type Charge Rule . Builder ( Payment Types . ACCOUNT _ M ONE Y , ĠBigDecimal . TEN ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Detail Modal ( object Ġ: ĠDynamic Dialog Creator Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġshould ShowDialog ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcontext : ĠContext , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcheckout Data : ĠDynamic Dialog Creator . Checkout Data ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġtrue ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġcreate ( context : ĠContext , Ġcheckout Data : ĠDynamic Dialog Creator . Checkout Data ): ĠDialog Fragment Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠDialog Fragment () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġdescribe Contents (): ĠInt Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġ 0 ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun ĠwriteTo Parcel ( parcel : ĠParcel , Ġi : ĠInt ) Ġ{} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠ ĠassertNotNull ( charge . detail Modal ) ĊĠĠĠ Ġ} Ċ }