// 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 android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
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 IsCheckedConstraintTest {

    @SuppressWarnings("ResourceType")
    @Test
    public void isValid() throws Exception {
        RadioGroup radioGroup = new RadioGroup(RuntimeEnvironment.application);
        radioGroup.check(1);
        assertEmpty("is valid with RadioGroup", new IsCheckedConstraint<View>(radioGroup, "radioGroup").validate());

        RadioButton radioButton = new RadioButton(RuntimeEnvironment.application);
        radioButton.setChecked(true);
// 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/IsCheckedConstraintTest.java
import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
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 IsCheckedConstraintTest {

    @SuppressWarnings("ResourceType")
    @Test
    public void isValid() throws Exception {
        RadioGroup radioGroup = new RadioGroup(RuntimeEnvironment.application);
        radioGroup.check(1);
        assertEmpty("is valid with RadioGroup", new IsCheckedConstraint<View>(radioGroup, "radioGroup").validate());

        RadioButton radioButton = new RadioButton(RuntimeEnvironment.application);
        radioButton.setChecked(true);
        assertEmpty("is valid with RadioButton", new IsCheckedConstraint<View>(radioButton, "radioButton").validate());