use of com.globalcollect.gateway.sdk.client.android.sdk.model.PaymentRequest in project connect-sdk-client-android by Ingenico-ePayments.
the class ValidationTest method testInValidRegex.
@Test
public void testInValidRegex() {
PaymentRequest paymentRequest = new TestPaymentRequest();
paymentRequest.setValue("regex", invalidRegex);
ValidationRuleRegex rule = new ValidationRuleRegex(regex, "", ValidationType.RANGE);
assertEquals(false, rule.validate(paymentRequest, "regex"));
}
use of com.globalcollect.gateway.sdk.client.android.sdk.model.PaymentRequest in project connect-sdk-client-android by Ingenico-ePayments.
the class ValidationTest method testValidRange.
// Test range validator
@Test
public void testValidRange() {
PaymentRequest paymentRequest = new TestPaymentRequest();
paymentRequest.setValue("range", validRange);
ValidationRuleRange rule = new ValidationRuleRange(minLength, maxLength, "", ValidationType.RANGE);
assertEquals(true, rule.validate(paymentRequest, "range"));
}
use of com.globalcollect.gateway.sdk.client.android.sdk.model.PaymentRequest in project connect-sdk-client-android by Ingenico-ePayments.
the class ValidationTest method testInvalidFixedList.
@Test
public void testInvalidFixedList() {
PaymentRequest paymentRequest = new TestPaymentRequest();
paymentRequest.setValue("fixedList", invalidListOption);
ValidationRuleFixedList rule = new ValidationRuleFixedList(listEntries, "", ValidationType.FIXEDLIST);
assertEquals(false, rule.validate(paymentRequest, "fixedList"));
}
use of com.globalcollect.gateway.sdk.client.android.sdk.model.PaymentRequest in project connect-sdk-client-android by Ingenico-ePayments.
the class ValidationTest method testValidLuhn.
// Test luhn validator
@Test
public void testValidLuhn() {
PaymentRequest paymentRequest = new TestPaymentRequest();
paymentRequest.setValue("luhn", validLuhnCheck);
ValidationRuleLuhn rule = new ValidationRuleLuhn("", ValidationType.LUHN);
assertEquals(true, rule.validate(paymentRequest, "luhn"));
}
use of com.globalcollect.gateway.sdk.client.android.sdk.model.PaymentRequest in project connect-sdk-client-android by Ingenico-ePayments.
the class ValidationTest method testValidLength.
// Test length validator
@Test
public void testValidLength() {
PaymentRequest paymentRequest = new TestPaymentRequest();
paymentRequest.setValue("length", validLength);
ValidationRuleLength rule = new ValidationRuleLength(minLength, maxLength, "", ValidationType.LENGTH);
assertEquals(true, rule.validate(paymentRequest, "length"));
}
Aggregations