// Path: library/src/test/java/com/comuto/validator/Utils.java
// public static void assertEmpty(String message, Iterable<?> iterable) {
//     if (iterable.iterator().hasNext()) {
//         failNotEmpty(message, iterable.toString());
//     }
// }
// 
// Path: library/src/test/java/com/comuto/validator/Utils.java
// public static void assertNotEmpty(String message, Iterable<?> iterable) {
//     if (!iterable.iterator().hasNext()) {
//         failEmpty(message);
//     }
// }


import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import static com.comuto.validator.Utils.assertEmpty;
import static com.comuto.validator.Utils.assertNotEmpty;
package com.comuto.validator.constraint;



@RunWith(RobolectricTestRunner.class) @Config(manifest = Config.NONE) public class EmailConstraintTest
    extends BaseConstraintTest {
    private static final String PROPERTY_NAME = "property_email";
    private static final String VALID = "peter.canvas+driver@blablacar.com";
    private static final String NOT_VALID = "to@";

    @Test
    public void isValid() throws Exception {
        assertEmpty("is valid with String", new EmailConstraint(VALID, PROPERTY_NAME).validate());

        assertEmpty("is valid with EditText", new EmailConstraint(generateEditText(VALID), PROPERTY_NAME).validate());

// Path: library/src/test/java/com/comuto/validator/Utils.java
// public static void assertEmpty(String message, Iterable<?> iterable) {
//     if (iterable.iterator().hasNext()) {
//         failNotEmpty(message, iterable.toString());
//     }
// }
// 
// Path: library/src/test/java/com/comuto/validator/Utils.java
// public static void assertNotEmpty(String message, Iterable<?> iterable) {
//     if (!iterable.iterator().hasNext()) {
//         failEmpty(message);
//     }
// }


// Path: library/src/test/java/com/comuto/validator/constraint/EmailConstraintTest.java
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import static com.comuto.validator.Utils.assertEmpty;
import static com.comuto.validator.Utils.assertNotEmpty;

package com.comuto.validator.constraint;



@RunWith(RobolectricTestRunner.class) @Config(manifest = Config.NONE) public class EmailConstraintTest
    extends BaseConstraintTest {
    private static final String PROPERTY_NAME = "property_email";
    private static final String VALID = "peter.canvas+driver@blablacar.com";
    private static final String NOT_VALID = "to@";

    @Test
    public void isValid() throws Exception {
        assertEmpty("is valid with String", new EmailConstraint(VALID, PROPERTY_NAME).validate());

        assertEmpty("is valid with EditText", new EmailConstraint(generateEditText(VALID), PROPERTY_NAME).validate());

        assertEmpty("is valid with Spinner", new EmailConstraint(generateSpinner(VALID), PROPERTY_NAME).validate());