类android.support.test.internal.util.Checks源码实例Demo

下面列出了怎么用android.support.test.internal.util.Checks的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: redux-android-sample   文件: Matchers.java
public static Matcher<View> withBGColor(final int color) {
    Checks.checkNotNull(color);
    return new BoundedMatcher<View, View>(View.class) {
        @Override
        public boolean matchesSafely(View view) {
            int currentColor = ((ColorDrawable) view.getBackground()).getColor();
            return color == currentColor;
        }
        @Override
        public void describeTo(Description description) {
            description.appendText("with background color: " + color);
        }
    };
}
 
源代码2 项目: Scoops   文件: TestUtils.java
public static Matcher<View> withTextColor(final int color) {
    Checks.checkNotNull(color);
    return new BoundedMatcher<View, TextView>(TextView.class) {
        @Override
        public boolean matchesSafely(TextView warning) {
            return color == warning.getCurrentTextColor();
        }
        @Override
        public void describeTo(Description description) {
            description.appendText("with text color: ");
        }
    };
}
 
源代码3 项目: restcomm-android-sdk   文件: BasicUITests.java
public static Matcher<View> withTextColor(final int color) {
    Checks.checkNotNull(color);
    return new BoundedMatcher<View, TextView>(TextView.class) {
        @Override
        public boolean matchesSafely(TextView textView) {
            return color == textView.getCurrentTextColor();
        }
        @Override
        public void describeTo(Description description) {
            description.appendText("Expected Color: " + color);
        }
    };
}
 
 类所在包
 类方法
 同包方法