Class CompareMatcher<T extends Comparable<T>>

java.lang.Object
org.hamcrest.BaseMatcher<T>
com._1c.g5.v8.dt.testing.matchers.CompareMatcher<T>
All Implemented Interfaces:
org.hamcrest.Matcher<T>, org.hamcrest.SelfDescribing

public class CompareMatcher<T extends Comparable<T>> extends org.hamcrest.BaseMatcher<T>
Matcher that matches if the examined Comparable value is greater than the provided value.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    describeMismatch(Object item, org.hamcrest.Description description)
     
    void
    describeTo(org.hamcrest.Description description)
     
    static <T extends Comparable<T>>
    org.hamcrest.Matcher<T>
    greaterThan(T value)
    Creates a matcher that matches if the examined Comparable value is greater than the provided value.
    static <T extends Comparable<T>>
    org.hamcrest.Matcher<T>
    lessThan(T value)
    Creates a matcher that matches if the examined Comparable value is less than the provided value.
    boolean
     

    Methods inherited from class org.hamcrest.BaseMatcher

    _dont_implement_Matcher___instead_extend_BaseMatcher_, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • matches

      public boolean matches(Object item)
    • describeTo

      public void describeTo(org.hamcrest.Description description)
    • describeMismatch

      public void describeMismatch(Object item, org.hamcrest.Description description)
      Specified by:
      describeMismatch in interface org.hamcrest.Matcher<T extends Comparable<T>>
      Overrides:
      describeMismatch in class org.hamcrest.BaseMatcher<T extends Comparable<T>>
    • lessThan

      public static <T extends Comparable<T>> org.hamcrest.Matcher<T> lessThan(T value)
      Creates a matcher that matches if the examined Comparable value is less than the provided value.

      For example:

       assertThat(Integer.valueOf(221), lessThan(Integer.valueOf(223)))
       
    • greaterThan

      public static <T extends Comparable<T>> org.hamcrest.Matcher<T> greaterThan(T value)
      Creates a matcher that matches if the examined Comparable value is greater than the provided value.

      For example:

       assertThat(Integer.valueOf(223), greaterThan(Integer.valueOf(221)))