Class ValueSetMatchers

java.lang.Object
org.faktorips.testsupport.ValueSetMatchers

public class ValueSetMatchers extends Object
Hamcrest Matchers for use in JUnit tests of Faktor-IPS value sets.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> org.hamcrest.Matcher<org.faktorips.valueset.ValueSet<T>>
    contains(T... values)
    Creates a Matcher that matches a ValueSet if it contains the given values.
    static org.hamcrest.Matcher<org.faktorips.valueset.ValueSet<?>>
    Creates a Matcher that matches a ValueSet if it contains null.
    static org.hamcrest.Matcher<org.faktorips.valueset.ValueSet<?>>
    Creates a Matcher that matches a ValueSet if it is empty.
    static <T extends Comparable<T>>
    org.hamcrest.Matcher<org.faktorips.valueset.ValueSet<T>>
    isRange(T lower, T upper)
    Creates a Matcher that matches a ValueSet if it is a range with the given lower and upper bound.

    Methods inherited from class java.lang.Object

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

    • empty

      public static org.hamcrest.Matcher<org.faktorips.valueset.ValueSet<?>> empty()
      Creates a Matcher that matches a ValueSet if it is empty.
    • containsNull

      public static org.hamcrest.Matcher<org.faktorips.valueset.ValueSet<?>> containsNull()
      Creates a Matcher that matches a ValueSet if it contains null.
    • isRange

      public static <T extends Comparable<T>> org.hamcrest.Matcher<org.faktorips.valueset.ValueSet<T>> isRange(T lower, T upper)
      Creates a Matcher that matches a ValueSet if it is a range with the given lower and upper bound.
      Type Parameters:
      T - the type of the range's bounds
      Parameters:
      lower - the expected lower bound
      upper - the expected upper bound
    • contains

      public static <T> org.hamcrest.Matcher<org.faktorips.valueset.ValueSet<T>> contains(T... values)
      Creates a Matcher that matches a ValueSet if it contains the given values.
      Type Parameters:
      T - the object type to match
      Parameters:
      values - the expected values