/** * 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 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 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 either of the specified matchers match the examined object. * For example: * <pre>assertThat("fan", either(containsString("a")).or(containsString("b")))</pre> */ public static <LHS> org.hamcrest.core.CombinableMatcher.CombinableEitherMatcher<LHS> either(org.hamcrest.Matcher<? super LHS> matcher) { return org.hamcrest.core.CombinableMatcher.either(matcher); }
/** * Creates a matcher that matches when either of the specified matchers match the examined object. * For example: * <pre>assertThat("fan", either(containsString("a")).or(containsString("b")))</pre> */ public static <LHS> org.hamcrest.core.CombinableMatcher.CombinableEitherMatcher<LHS> either(org.hamcrest.Matcher<? super LHS> matcher) { return org.hamcrest.core.CombinableMatcher.either(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); }
/** * Creates a matcher that matches when either of the specified matchers match the examined object. * For example: * <pre>assertThat("fan", either(containsString("a")).or(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 either of the specified matchers match the examined object. * For example: * <pre>assertThat("fan", either(containsString("a")).or(containsString("b")))</pre> */ public static <LHS> org.hamcrest.core.CombinableMatcher.CombinableEitherMatcher<LHS> either(org.hamcrest.Matcher<? super LHS> matcher) { return org.hamcrest.core.CombinableMatcher.either(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); }
/** * 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 either of the specified matchers match the examined object. * For example: * <pre>assertThat("fan", either(containsString("a")).or(containsString("b")))</pre> */ public static <LHS> org.hamcrest.core.CombinableMatcher.CombinableEitherMatcher<LHS> either(org.hamcrest.Matcher<? super LHS> matcher) { return org.hamcrest.core.CombinableMatcher.either(matcher); }
/** * Creates a matcher that matches when either of the specified matchers match the examined object. * For example: * <pre>assertThat("fan", either(containsString("a")).or(containsString("b")))</pre> */ public static <LHS> org.hamcrest.core.CombinableMatcher.CombinableEitherMatcher<LHS> either(org.hamcrest.Matcher<? super LHS> matcher) { return org.hamcrest.core.CombinableMatcher.either(matcher); }
/** * Creates a matcher that matches when either of the specified matchers match the examined object. */ public static <LHS> org.hamcrest.core.CombinableMatcher.CombinableEitherMatcher<Iterable<LHS>> either(OutputMatcher<LHS> matcher) { return org.hamcrest.core.CombinableMatcher.either(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); }
/** * 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 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 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 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); }
private static List<Matcher<Iterable<? super String>>> filesList(String... filenames) { List<Matcher<Iterable<? super String>>> result = new ArrayList<Matcher<Iterable<? super String>>>(); for (String current : filenames) { String filename = current.toString(); result.add(either(hasItem(filename)).or(hasItem(endsWith(separatorsToWindows(filename))))); } return result; }
@Test public void testAssertThatHamcrestCoreMatchers() { assertThat("good", allOf(equalTo("good"), startsWith("good"))); assertThat("good", not(allOf(equalTo("bad"), equalTo("good")))); assertThat("good", anyOf(equalTo("bad"), equalTo("good"))); assertThat(7, not(CombinableMatcher.either(equalTo(3)).or(equalTo(4)))); assertThat(new Object(), not(sameInstance(new Object()))); }