String invalidStringCase = "region_code: " + regionCode + ", national_number: " +
exampleShortNumber;
invalidStringCases.add(invalidStringCase);
LOGGER.log(Level.SEVERE, "Failed validation for string " + invalidStringCase);
}
PhoneNumber phoneNumber = phoneNumberUtil.parse(exampleShortNumber, regionCode);
if (!shortNumberInfo.isValidShortNumber(phoneNumber)) {
invalidCases.add(phoneNumber);
LOGGER.log(Level.SEVERE, "Failed validation for " + phoneNumber.toString());
}
for (ShortNumberInfo.ShortNumberCost cost : ShortNumberInfo.ShortNumberCost.values()) {
exampleShortNumber = shortNumberInfo.getExampleShortNumberForCost(regionCode, cost);
if (!exampleShortNumber.equals("")) {
if (cost != shortNumberInfo.getExpectedCostForRegion(
phoneNumberUtil.parse(exampleShortNumber, regionCode), regionCode)) {
wrongTypeCases.add(phoneNumber);
LOGGER.log(Level.SEVERE, "Wrong cost for " + phoneNumber.toString());
}
}
}
}
assertEquals(0, invalidStringCases.size());