Interface ExpectedObject<T>

Type Parameters:
T - the type of the expected object
All Superinterfaces:
Expected
All Known Subinterfaces:
ExpectedException<T>

public interface ExpectedObject<T> extends Expected

A type representing the expected object in a test.

  • Field Summary

    Fields inherited from interface org.tudalgo.algoutils.tutor.general.assertions.expected.Expected

    BRACKET_FORMATTER
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> ExpectedObject<T>
    of(T object, Predicate<T> test)
    Returns an expected behavior where the expected object is described with the given object.
    static <T> ExpectedObject<T>
    of(T object, Predicate<T> test, Function<String,String> formatter)
    Returns an expected behavior where the expected object is described with the given object.
    boolean
    test(T object)
    Returns true if the given object is as expected.

    Methods inherited from interface org.tudalgo.algoutils.tutor.general.assertions.expected.Expected

    behavior, display, string
  • Method Details

    • of

      static <T> ExpectedObject<T> of(T object, Predicate<T> test, Function<String,String> formatter)

      Returns an expected behavior where the expected object is described with the given object.

      If a given object is as expected is only tested by the given test.

      Type Parameters:
      T - the type of the expected object
      Parameters:
      object - the object describing the expected behavior
      test - the test to determine if the given object is as expected
      formatter - the formatter
      Returns:
      the expected behavior
    • of

      static <T> ExpectedObject<T> of(T object, Predicate<T> test)

      Returns an expected behavior where the expected object is described with the given object.

      If a given object is as expected is only tested by the given test.

      Type Parameters:
      T - the type of the expected object
      Parameters:
      object - the object describing the expected behavior
      test - the test to determine if the given object is as expected
      Returns:
      the expected behavior
    • test

      boolean test(T object)

      Returns true if the given object is as expected.

      Parameters:
      object - the object
      Returns:
      true if the given object is as expected