本文整理汇总了Java中org.hamcrest.Matchers.allOf方法的典型用法代码示例。如果您正苦于以下问题:Java Matchers.allOf方法的具体用法?Java Matchers.allOf怎么用?Java Matchers.allOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hamcrest.Matchers
的用法示例。
在下文中一共展示了Matchers.allOf方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: textView_returnsProperMatcher
import org.hamcrest.Matchers; //导入方法依赖的package包/类
@Test
public void textView_returnsProperMatcher() {
//given
final Cortado.OrAnd.Matcher matcher = Cortado.textView().withText("test");
final Matcher<View> expectedEspressoMatcher = Matchers.allOf(
ViewMatchers.isAssignableFrom(TextView.class),
matcher.getCortado().matchers.get(0));
//when
//then
Utils.assertThat(matcher).isEqualTo(expectedEspressoMatcher);
}
示例2: editText_returnsProperMatcher
import org.hamcrest.Matchers; //导入方法依赖的package包/类
@Test
public void editText_returnsProperMatcher() {
//given
final Cortado.OrAnd.Matcher matcher = Cortado.editText().withText("test");
final Matcher<View> expectedEspressoMatcher = Matchers.allOf(
ViewMatchers.isAssignableFrom(EditText.class),
matcher.getCortado().matchers.get(0));
//when
//then
Utils.assertThat(matcher).isEqualTo(expectedEspressoMatcher);
}
示例3: button_returnsProperMatcher
import org.hamcrest.Matchers; //导入方法依赖的package包/类
@Test
public void button_returnsProperMatcher() {
//given
final Cortado.OrAnd.Matcher matcher = Cortado.button().withText("test");
final Matcher<View> expectedEspressoMatcher = Matchers.allOf(
ViewMatchers.isAssignableFrom(Button.class),
matcher.getCortado().matchers.get(0));
//when
//then
Utils.assertThat(matcher).isEqualTo(expectedEspressoMatcher);
}
示例4: imageView_returnsProperMatcher
import org.hamcrest.Matchers; //导入方法依赖的package包/类
@Test
public void imageView_returnsProperMatcher() {
//given
final Cortado.OrAnd.Matcher matcher = Cortado.imageView().withText("test");
final Matcher<View> expectedEspressoMatcher = Matchers.allOf(
ViewMatchers.isAssignableFrom(ImageView.class),
matcher.getCortado().matchers.get(0));
//when
//then
Utils.assertThat(matcher).isEqualTo(expectedEspressoMatcher);
}
示例5: imageButton_returnsProperMatcher
import org.hamcrest.Matchers; //导入方法依赖的package包/类
@Test
public void imageButton_returnsProperMatcher() {
//given
final Cortado.OrAnd.Matcher matcher = Cortado.imageButton().withText("test");
final Matcher<View> expectedEspressoMatcher = Matchers.allOf(
ViewMatchers.isAssignableFrom(ImageButton.class),
matcher.getCortado().matchers.get(0));
//when
//then
Utils.assertThat(matcher).isEqualTo(expectedEspressoMatcher);
}
示例6: onTextView_returnsProperViewInteraction
import org.hamcrest.Matchers; //导入方法依赖的package包/类
@Test
public void onTextView_returnsProperViewInteraction() {
//given
final Cortado.OrAnd.ViewInteraction viewInteraction = Cortado.onTextView().withText("test");
final Matcher<View> expectedEspressoMatcher = Matchers.allOf(
ViewMatchers.isAssignableFrom(TextView.class),
viewInteraction.getCortado().matchers.get(0));
//when
final Matcher<View> rawMatcher = viewInteraction.getCortado().get();
//then
Utils.assertThat(rawMatcher).isEqualTo(expectedEspressoMatcher);
}
示例7: onEditText_returnsProperViewInteraction
import org.hamcrest.Matchers; //导入方法依赖的package包/类
@Test
public void onEditText_returnsProperViewInteraction() {
//given
final Cortado.OrAnd.ViewInteraction viewInteraction = Cortado.onEditText().withText("test");
final Matcher<View> expectedEspressoMatcher = Matchers.allOf(
ViewMatchers.isAssignableFrom(EditText.class),
viewInteraction.getCortado().matchers.get(0));
//when
final Matcher<View> rawMatcher = viewInteraction.getCortado().get();
//then
Utils.assertThat(rawMatcher).isEqualTo(expectedEspressoMatcher);
}
示例8: onButton_returnsProperViewInteraction
import org.hamcrest.Matchers; //导入方法依赖的package包/类
@Test
public void onButton_returnsProperViewInteraction() {
//given
final Cortado.OrAnd.ViewInteraction viewInteraction = Cortado.onButton().withText("test");
final Matcher<View> expectedEspressoMatcher = Matchers.allOf(
ViewMatchers.isAssignableFrom(Button.class),
viewInteraction.getCortado().matchers.get(0));
//when
final Matcher<View> rawMatcher = viewInteraction.getCortado().get();
//then
Utils.assertThat(rawMatcher).isEqualTo(expectedEspressoMatcher);
}
示例9: onImageView_returnsProperViewInteraction
import org.hamcrest.Matchers; //导入方法依赖的package包/类
@Test
public void onImageView_returnsProperViewInteraction() {
//given
final Cortado.OrAnd.ViewInteraction viewInteraction = Cortado.onImageView().withText("test");
final Matcher<View> expectedEspressoMatcher = Matchers.allOf(
ViewMatchers.isAssignableFrom(ImageView.class),
viewInteraction.getCortado().matchers.get(0));
//when
final Matcher<View> rawMatcher = viewInteraction.getCortado().get();
//then
Utils.assertThat(rawMatcher).isEqualTo(expectedEspressoMatcher);
}
示例10: onImageButton_returnsProperViewInteraction
import org.hamcrest.Matchers; //导入方法依赖的package包/类
@Test
public void onImageButton_returnsProperViewInteraction() {
//given
final Cortado.OrAnd.ViewInteraction viewInteraction = Cortado.onImageButton().withText("test");
final Matcher<View> expectedEspressoMatcher = Matchers.allOf(
ViewMatchers.isAssignableFrom(ImageButton.class),
viewInteraction.getCortado().matchers.get(0));
//when
final Matcher<View> rawMatcher = viewInteraction.getCortado().get();
//then
Utils.assertThat(rawMatcher).isEqualTo(expectedEspressoMatcher);
}
示例11: getConstraints
import org.hamcrest.Matchers; //导入方法依赖的package包/类
public Matcher<View> getConstraints() {
return Matchers.allOf(new Matcher[] {
ViewMatchers.isAssignableFrom(RecyclerView.class), ViewMatchers.isDisplayed()
});
}
示例12: link
import org.hamcrest.Matchers; //导入方法依赖的package包/类
@Override
Matcher<? super View> link(List<Matcher<? super View>> matchers) {
return Matchers.allOf(matchers);
}