// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/DrawableMatcher.java
// @CheckResult public static DrawableMatcher withDrawable(@DrawableRes final int resourceId) {
//   return new DrawableMatcher(resourceId);
// }
// 
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/DrawableMatcher.java
// @CheckResult public static DrawableMatcher withNoDrawable() {
//   return new DrawableMatcher(NO_DRAWABLE);
// }
// 
// Path: espresso-core-utils/src/androidTest/java/com/vanniktech/espresso/core/utils/DrawableMatcherActivity.java
// static final int VIEW_ID = 1234;


import androidx.annotation.DrawableRes;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;
import com.vanniktech.espresso.core.utils.test.R;
import junit.framework.AssertionFailedError;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import static android.view.View.GONE;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static com.vanniktech.espresso.core.utils.DrawableMatcher.withDrawable;
import static com.vanniktech.espresso.core.utils.DrawableMatcher.withNoDrawable;
import static com.vanniktech.espresso.core.utils.DrawableMatcherActivity.VIEW_ID;
  @Test public void withNoDrawableDoesNotMatchOnGone() throws Throwable {
    setVisibility(GONE);

    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with no drawable' doesn't match the selected view.");
    onView(withId(VIEW_ID)).check(matches(withNoDrawable()));
  }

  @Test public void withDrawableDoesNotMatchOnGone() throws Throwable {
    setDrawable(R.drawable.android);
    setVisibility(GONE);

    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with drawable from resource id: <" + R.drawable.android + ">' doesn't match the selected view.");
    onView(withId(VIEW_ID)).check(matches(withDrawable(R.drawable.android)));
  }

  @Test public void withNoDrawableDoesNotMatch() throws Throwable {
    setDrawable(R.drawable.android);

    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with no drawable' doesn't match the selected view.");
    onView(withId(VIEW_ID)).check(matches(withNoDrawable()));
  }

  @Test public void withDrawableDoesNotMatch() throws Throwable {
    setDrawable(R.drawable.android);

    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with drawable from resource id: <" + R.drawable.northern_lights + ">' doesn't match the selected view.");
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/DrawableMatcher.java
// @CheckResult public static DrawableMatcher withDrawable(@DrawableRes final int resourceId) {
//   return new DrawableMatcher(resourceId);
// }
// 
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/DrawableMatcher.java
// @CheckResult public static DrawableMatcher withNoDrawable() {
//   return new DrawableMatcher(NO_DRAWABLE);
// }
// 
// Path: espresso-core-utils/src/androidTest/java/com/vanniktech/espresso/core/utils/DrawableMatcherActivity.java
// static final int VIEW_ID = 1234;


// Path: espresso-core-utils/src/androidTest/java/com/vanniktech/espresso/core/utils/DrawableMatcherTest.java
import androidx.annotation.DrawableRes;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;
import com.vanniktech.espresso.core.utils.test.R;
import junit.framework.AssertionFailedError;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import static android.view.View.GONE;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static com.vanniktech.espresso.core.utils.DrawableMatcher.withDrawable;
import static com.vanniktech.espresso.core.utils.DrawableMatcher.withNoDrawable;
import static com.vanniktech.espresso.core.utils.DrawableMatcherActivity.VIEW_ID;

  @Test public void withNoDrawableDoesNotMatchOnGone() throws Throwable {
    setVisibility(GONE);

    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with no drawable' doesn't match the selected view.");
    onView(withId(VIEW_ID)).check(matches(withNoDrawable()));
  }

  @Test public void withDrawableDoesNotMatchOnGone() throws Throwable {
    setDrawable(R.drawable.android);
    setVisibility(GONE);

    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with drawable from resource id: <" + R.drawable.android + ">' doesn't match the selected view.");
    onView(withId(VIEW_ID)).check(matches(withDrawable(R.drawable.android)));
  }

  @Test public void withNoDrawableDoesNotMatch() throws Throwable {
    setDrawable(R.drawable.android);

    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with no drawable' doesn't match the selected view.");
    onView(withId(VIEW_ID)).check(matches(withNoDrawable()));
  }

  @Test public void withDrawableDoesNotMatch() throws Throwable {
    setDrawable(R.drawable.android);

    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with drawable from resource id: <" + R.drawable.northern_lights + ">' doesn't match the selected view.");
    onView(withId(VIEW_ID)).check(matches(withDrawable(R.drawable.northern_lights)));