use of com.globalcollect.gateway.sdk.client.android.sdk.model.PaymentRequest in project connect-sdk-client-android by Ingenico-ePayments.
the class ValidationTest method testValidEmailAddress.
// Test emailaddress validator
@Test
public void testValidEmailAddress() {
PaymentRequest paymentRequest = new TestPaymentRequest();
paymentRequest.setValue("emailAddress", emailAddressValid);
ValidationRuleEmailAddress rule = new ValidationRuleEmailAddress("", ValidationType.EMAILADDRESS);
assertEquals(true, rule.validate(paymentRequest, "emailAddress"));
}
use of com.globalcollect.gateway.sdk.client.android.sdk.model.PaymentRequest in project connect-sdk-client-android by Ingenico-ePayments.
the class ValidationTest method testInValidTermsAndConditions.
@Test
public void testInValidTermsAndConditions() {
PaymentRequest paymentRequest = new TestPaymentRequest();
paymentRequest.setValue("termsAndConditions", "test");
ValidationRuleTermsAndConditions rule = new ValidationRuleTermsAndConditions("", ValidationType.TERMSANDCONDITIONS);
assertEquals(false, rule.validate(paymentRequest, "termsAndConditions"));
}
use of com.globalcollect.gateway.sdk.client.android.sdk.model.PaymentRequest in project connect-sdk-client-android by Ingenico-ePayments.
the class ValidationTest method testInvalidExpirationDate.
@Test
public void testInvalidExpirationDate() {
PaymentRequest paymentRequest = new TestPaymentRequest();
paymentRequest.setValue("expirationDate", expirationDateInvalid);
ValidationRuleExpirationDate rule = new ValidationRuleExpirationDate("", ValidationType.EXPIRATIONDATE);
assertEquals(false, rule.validate(paymentRequest, "expirationDate"));
}
use of com.globalcollect.gateway.sdk.client.android.sdk.model.PaymentRequest in project connect-sdk-client-android by Ingenico-ePayments.
the class ValidationTest method testValidExpirationDate.
// Test expirationdate validator
@Test
public void testValidExpirationDate() {
PaymentRequest paymentRequest = new TestPaymentRequest();
paymentRequest.setValue("expirationDate", expirationDateValid);
ValidationRuleExpirationDate rule = new ValidationRuleExpirationDate("", ValidationType.EXPIRATIONDATE);
assertEquals(true, rule.validate(paymentRequest, "expirationDate"));
}
use of com.globalcollect.gateway.sdk.client.android.sdk.model.PaymentRequest in project connect-sdk-client-android by Ingenico-ePayments.
the class ValidationTest method testInvalidRange.
@Test
public void testInvalidRange() {
PaymentRequest paymentRequest = new TestPaymentRequest();
paymentRequest.setValue("range", invalidRange);
ValidationRuleRange rule = new ValidationRuleRange(minLength, maxLength, "", ValidationType.RANGE);
assertEquals(false, rule.validate(paymentRequest, "range"));
}
Aggregations