// Path: src/main/java/com/nikhaldimann/viewselector/ViewSelectorAssertions.java
// public static ViewSelectionAssert assertThatSelection(String selector, Activity activity) {
//     return assertThat(selection(selector, activity));
// }
// 
// Path: src/main/java/com/nikhaldimann/viewselector/attributes/AttributeAccessException.java
// public class AttributeAccessException extends RuntimeException {
// 
//     public AttributeAccessException(Exception cause) {
//         super(cause);
//     }
// 
//     public AttributeAccessException(String message, Exception cause) {
//         super(message, cause);
//     }
// 
// }
// 
// Path: src/test-lib/src/com/nikhaldimann/viewselector/test/util/ViewSelectorAndroidTestCase.java
// public abstract class ViewSelectorAndroidTestCase extends AndroidTestCase {
// 
//     protected ViewFactory viewFactory;
// 
//     @Before
//     public void setUp() throws Exception {
//         super.setUp();
//         viewFactory = createViewFactory();
//     }
// 
//     /**
//      * @return the factory to be used for creating views in this test
//      */
//     protected abstract ViewFactory createViewFactory();
// 
//     /**
//      * Reimplementation of Android's MoreAsserts.assertContentsInOrder() because we
//      * can't use MoreAsserts in Robolectric 1.2.
//      */
//     public static void assertContentsInOrder(Iterable<?> actual, Object... expected) {
//         ArrayList<Object> actualList = new ArrayList<Object>();
//         for (Object o : actual) {
//             actualList.add(o);
//         }
//         assertEquals(Arrays.asList(expected), actualList);
//     }
// }


import static com.nikhaldimann.viewselector.ViewSelectorAssertions.assertThatSelection;
import org.junit.Test;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.nikhaldimann.viewselector.attributes.AttributeAccessException;
import com.nikhaldimann.viewselector.test.util.ViewSelectorAndroidTestCase;

    @Test
    public void testFailingHasAttributeEqualTo() {
        try {
            assertThatSelection("TextView", viewFactory.createTextView())
                .hasAttributeEqualTo("text", "foo");
            failHard();
        } catch (AssertionError ex) {
            // expected
        }
    }

    @Test
    public void testFailingHasAttributeEqualToOnEmptySelection() {
        TextView view = viewFactory.createTextView();
        view.setTag("foo");
        try {
            assertThatSelection("ImageView", view).hasAttributeEqualTo("tag", "foo");
            failHard();
        } catch (AssertionError ex) {
            // expected
        }
    }

    @Test
    public void testNonExistentHasAttributeEqualTo() {
        try {
            assertThatSelection("TextView", viewFactory.createTextView())
                .hasAttributeEqualTo("foo", "bar");
            failHard();
// Path: src/main/java/com/nikhaldimann/viewselector/ViewSelectorAssertions.java
// public static ViewSelectionAssert assertThatSelection(String selector, Activity activity) {
//     return assertThat(selection(selector, activity));
// }
// 
// Path: src/main/java/com/nikhaldimann/viewselector/attributes/AttributeAccessException.java
// public class AttributeAccessException extends RuntimeException {
// 
//     public AttributeAccessException(Exception cause) {
//         super(cause);
//     }
// 
//     public AttributeAccessException(String message, Exception cause) {
//         super(message, cause);
//     }
// 
// }
// 
// Path: src/test-lib/src/com/nikhaldimann/viewselector/test/util/ViewSelectorAndroidTestCase.java
// public abstract class ViewSelectorAndroidTestCase extends AndroidTestCase {
// 
//     protected ViewFactory viewFactory;
// 
//     @Before
//     public void setUp() throws Exception {
//         super.setUp();
//         viewFactory = createViewFactory();
//     }
// 
//     /**
//      * @return the factory to be used for creating views in this test
//      */
//     protected abstract ViewFactory createViewFactory();
// 
//     /**
//      * Reimplementation of Android's MoreAsserts.assertContentsInOrder() because we
//      * can't use MoreAsserts in Robolectric 1.2.
//      */
//     public static void assertContentsInOrder(Iterable<?> actual, Object... expected) {
//         ArrayList<Object> actualList = new ArrayList<Object>();
//         for (Object o : actual) {
//             actualList.add(o);
//         }
//         assertEquals(Arrays.asList(expected), actualList);
//     }
// }


// Path: src/test-lib/src/com/nikhaldimann/viewselector/test/abstrakt/AbstractViewSelectionAssertTest.java
import static com.nikhaldimann.viewselector.ViewSelectorAssertions.assertThatSelection;
import org.junit.Test;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.nikhaldimann.viewselector.attributes.AttributeAccessException;
import com.nikhaldimann.viewselector.test.util.ViewSelectorAndroidTestCase;


    @Test
    public void testFailingHasAttributeEqualTo() {
        try {
            assertThatSelection("TextView", viewFactory.createTextView())
                .hasAttributeEqualTo("text", "foo");
            failHard();
        } catch (AssertionError ex) {
            // expected
        }
    }

    @Test
    public void testFailingHasAttributeEqualToOnEmptySelection() {
        TextView view = viewFactory.createTextView();
        view.setTag("foo");
        try {
            assertThatSelection("ImageView", view).hasAttributeEqualTo("tag", "foo");
            failHard();
        } catch (AssertionError ex) {
            // expected
        }
    }

    @Test
    public void testNonExistentHasAttributeEqualTo() {
        try {
            assertThatSelection("TextView", viewFactory.createTextView())
                .hasAttributeEqualTo("foo", "bar");
            failHard();
        } catch (AttributeAccessException ex) {