use of com.globalcollect.gateway.sdk.client.android.sdk.formatter.StringFormatter in project connect-sdk-client-android by Ingenico-ePayments.
the class MaskTest method testMaskingSingleCharacterInclCursor.
@Test
public void testMaskingSingleCharacterInclCursor() {
StringFormatter formatter = new StringFormatter();
FormatResult maskedValue = formatter.applyMask(maskExpiryDate, maskTestString1, emptyString, 0);
assertEquals("1", maskedValue.getFormattedResult());
assertTrue(maskedValue.getCursorIndex() == 1);
}
use of com.globalcollect.gateway.sdk.client.android.sdk.formatter.StringFormatter in project connect-sdk-client-android by Ingenico-ePayments.
the class MaskTest method testMaskTwoCharacters.
@Test
public void testMaskTwoCharacters() {
StringFormatter formatter = new StringFormatter();
String maskedValue = formatter.applyMask(maskExpiryDate, maskTestString2);
assertEquals("12-", maskedValue);
}
use of com.globalcollect.gateway.sdk.client.android.sdk.formatter.StringFormatter in project connect-sdk-client-android by Ingenico-ePayments.
the class MaskTest method testMaskSingleCharacter.
@Test
public void testMaskSingleCharacter() {
StringFormatter formatter = new StringFormatter();
String maskedValue = formatter.applyMask(maskExpiryDate, maskTestString1);
assertEquals("1", maskedValue);
}
use of com.globalcollect.gateway.sdk.client.android.sdk.formatter.StringFormatter in project connect-sdk-client-android by Ingenico-ePayments.
the class MaskTest method testUnmaskingSingleCharacter.
@Test
public void testUnmaskingSingleCharacter() {
StringFormatter formatter = new StringFormatter();
String maskedValue = formatter.removeMask(maskExpiryDate, maskTestString1);
assertEquals("1", maskedValue);
}
use of com.globalcollect.gateway.sdk.client.android.sdk.formatter.StringFormatter in project connect-sdk-client-android by Ingenico-ePayments.
the class MaskTest method testInsertCharacterInStringInclCursor.
@Test
public void testInsertCharacterInStringInclCursor() {
StringFormatter formatter = new StringFormatter();
FormatResult maskedValue = formatter.applyMask(maskExpiryDate, "11-22", maskTestString2, 1);
assertEquals("11-22", maskedValue.getFormattedResult());
assertTrue(maskedValue.getCursorIndex() == 4);
}
Aggregations