コード例 #1
0
 @Test(timeout = 1000)
 public void getCanonicalName_returnsCorrectString() {
   assertEquals("Visa", PaymentMethodType.VISA.getCanonicalName());
   assertEquals("MasterCard", PaymentMethodType.MASTERCARD.getCanonicalName());
   assertEquals("Discover", PaymentMethodType.DISCOVER.getCanonicalName());
   assertEquals("American Express", PaymentMethodType.AMEX.getCanonicalName());
   assertEquals("JCB", PaymentMethodType.JCB.getCanonicalName());
   assertEquals("Diners", PaymentMethodType.DINERS.getCanonicalName());
   assertEquals("Maestro", PaymentMethodType.MAESTRO.getCanonicalName());
   assertEquals("PayPal", PaymentMethodType.PAYPAL.getCanonicalName());
   assertEquals("Google Wallet", PaymentMethodType.ANDROID_PAY.getCanonicalName());
   assertEquals("unknown", PaymentMethodType.UNKNOWN.getCanonicalName());
 }
コード例 #2
0
 @Test(timeout = 1000)
 public void getDrawable_returnsCorrectDrawables() {
   assertEquals(R.drawable.bt_visa, PaymentMethodType.VISA.getDrawable());
   assertEquals(R.drawable.bt_mastercard, PaymentMethodType.MASTERCARD.getDrawable());
   assertEquals(R.drawable.bt_discover, PaymentMethodType.DISCOVER.getDrawable());
   assertEquals(R.drawable.bt_amex, PaymentMethodType.AMEX.getDrawable());
   assertEquals(R.drawable.bt_jcb, PaymentMethodType.JCB.getDrawable());
   assertEquals(R.drawable.bt_diners, PaymentMethodType.DINERS.getDrawable());
   assertEquals(R.drawable.bt_maestro, PaymentMethodType.MAESTRO.getDrawable());
   assertEquals(R.drawable.bt_paypal, PaymentMethodType.PAYPAL.getDrawable());
   assertEquals(R.drawable.bt_android_pay, PaymentMethodType.ANDROID_PAY.getDrawable());
   assertEquals(0, PaymentMethodType.UNKNOWN.getDrawable());
 }
コード例 #3
0
 @Test(timeout = 1000)
 public void getLocalizedName_returnsCorrectString() {
   assertEquals(R.string.bt_descriptor_visa, PaymentMethodType.VISA.getLocalizedName());
   assertEquals(
       R.string.bt_descriptor_mastercard, PaymentMethodType.MASTERCARD.getLocalizedName());
   assertEquals(R.string.bt_descriptor_discover, PaymentMethodType.DISCOVER.getLocalizedName());
   assertEquals(R.string.bt_descriptor_amex, PaymentMethodType.AMEX.getLocalizedName());
   assertEquals(R.string.bt_descriptor_jcb, PaymentMethodType.JCB.getLocalizedName());
   assertEquals(R.string.bt_descriptor_diners, PaymentMethodType.DINERS.getLocalizedName());
   assertEquals(R.string.bt_descriptor_maestro, PaymentMethodType.MAESTRO.getLocalizedName());
   assertEquals(R.string.bt_descriptor_paypal, PaymentMethodType.PAYPAL.getLocalizedName());
   assertEquals(
       R.string.bt_descriptor_android_pay, PaymentMethodType.ANDROID_PAY.getLocalizedName());
   assertEquals(R.string.bt_descriptor_unknown, PaymentMethodType.UNKNOWN.getLocalizedName());
 }