testing-samples
testing-samples copied to clipboard
Why does BasicSample validate email field on every character change and not just when the Save button is pressed?
android-testing/unit/BasicSample adds a listener like this:
mEmailText.addTextChangedListener(mEmailValidator);
And then on save it checks
if (!mEmailValidator.isValid()) {
mEmailText.setError("Invalid email");}
Why not just have a simple utility class which will perform this check only when the save button is pressed? Just asking for a clarification.