public CombinableMatcher<X> and(Matcher<? super X> other) { return new CombinableMatcher<X>(first).and(other); } }
/** * Creates a matcher that matches when both of the specified matchers match the examined object. * <p/> * For example: * <pre>assertThat("fab", both(containsString("a")).and(containsString("b")))</pre> */ public static <LHS> org.hamcrest.core.CombinableMatcher.CombinableBothMatcher<LHS> both(org.hamcrest.Matcher<? super LHS> matcher) { return org.hamcrest.core.CombinableMatcher.<LHS>both(matcher); }
/** * Creates a matcher that matches when either of the specified matchers match the examined object. * <p/> * For example: * <pre>assertThat("fan", either(containsString("a")).and(containsString("b")))</pre> */ public static <LHS> org.hamcrest.core.CombinableMatcher.CombinableEitherMatcher<LHS> either(org.hamcrest.Matcher<? super LHS> matcher) { return org.hamcrest.core.CombinableMatcher.<LHS>either(matcher); }
public CombinableMatcher<X> or(Matcher<? super X> other) { return new CombinableMatcher<X>(first).or(other); } }
public CombinableMatcher<T> and(Matcher<? super T> other) { return new CombinableMatcher<T>(new AllOf<T>(templatedListWith(other))); }
@Test public void testToString() throws Exception { MovieTestData.MOVIES_LIST.forEach(movie -> assertThat(movie.toString(), both(containsString("title=" + movie.getTitle())) .and(containsString("year=" + movie.getYear())) .and(containsString("rating=" + movie.getRating())) .and(containsString("imdbId=" + movie.getImdbId())) )); }
@Test public void acceptsAndRejectsThreeOrs() { final CombinableMatcher<Integer> tripleOr = EITHER_3_OR_4.or(equalTo(11)); assertMatches("tripleOr didn't pass", tripleOr, 11); assertDoesNotMatch("tripleOr didn't fail", tripleOr, 9); }
@Test public void acceptsAndRejectsThreeAnds() { CombinableMatcher<? super Integer> tripleAnd = NOT_3_AND_NOT_4.and(equalTo(2)); assertMatches("tripleAnd didn't pass", tripleAnd, 2); assertDoesNotMatch("tripleAnd didn't fail", tripleAnd, 3); }
public CombinableMatcher<T> or(Matcher<? super T> other) { return new CombinableMatcher<T>(new AnyOf<T>(templatedListWith(other))); }
public CombinableMatcher<X> or(Matcher<? super X> other) { return new CombinableMatcher<X>(first).or(other); } }
@Test public void testToString() throws Exception { ImportProgressTestData.IMPORT_PROGRESS_LIST.forEach(ip -> assertThat(ip.toString(), both(containsString("kinopoiskFile=" + ip.getKinopoiskFile())) .and(containsString("movie=" + ip.getMovie())) .and(containsString("imported=" + ip.isImported())) .and(containsString("rated=" + ip.isRated())) )); } }
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_ACTIVITY) public void testRequiredHistoryLevelActivity() { assertThat(currentHistoryLevel(), CoreMatchers.<String>either(is(ProcessEngineConfiguration.HISTORY_ACTIVITY)) .or(is(ProcessEngineConfiguration.HISTORY_AUDIT)) .or(is(ProcessEngineConfiguration.HISTORY_FULL))); }
public CombinableMatcher<X> and(Matcher<? super X> other) { return new CombinableMatcher<X>(first).and(other); } }
public CombinableMatcher<T> or(Matcher<? super T> other) { return new CombinableMatcher<T>(new AnyOf<T>(templatedListWith(other))); }
public CombinableMatcher<X> or(Matcher<? super X> other) { return new CombinableMatcher<>(first).or(other); } }
/** * Creates a matcher that matches when either of the specified matchers match the examined object. * <p/> * For example: * <pre>assertThat("fan", either(containsString("a")).and(containsString("b")))</pre> */ public static <LHS> org.hamcrest.core.CombinableMatcher.CombinableEitherMatcher<LHS> either(org.hamcrest.Matcher<? super LHS> matcher) { return org.hamcrest.core.CombinableMatcher.<LHS>either(matcher); }
/** * Creates a matcher that matches when both of the specified matchers match the examined object. * <p/> * For example: * <pre>assertThat("fab", both(containsString("a")).and(containsString("b")))</pre> */ public static <LHS> org.hamcrest.core.CombinableMatcher.CombinableBothMatcher<LHS> both(org.hamcrest.Matcher<? super LHS> matcher) { return org.hamcrest.core.CombinableMatcher.<LHS>both(matcher); }
@Test @RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_ACTIVITY) public void requiredHistoryLevelActivity() { assertThat(currentHistoryLevel(), CoreMatchers.<String>either(is(ProcessEngineConfiguration.HISTORY_ACTIVITY)) .or(is(ProcessEngineConfiguration.HISTORY_AUDIT)) .or(is(ProcessEngineConfiguration.HISTORY_FULL))); }
public CombinableMatcher<X> and(Matcher<? super X> other) { return new CombinableMatcher<>(first).and(other); } }
public CombinableMatcher<T> and(Matcher<? super T> other) { return new CombinableMatcher<T>(new AllOf<T>(templatedListWith(other))); }