Interface ActualException<T extends Throwable>
- Type Parameters:
T- the type of the expected exception
- All Superinterfaces:
Actual,ActualObject<T>
A type representing the expected exceptional behavior in a test.
-
Field Summary
FieldsModifier and TypeFieldDescriptionA function enclosing an already enclosed type with default text.Fields inherited from interface org.tudalgo.algoutils.tutor.general.assertions.actual.Actual
BRACKET_FORMATTER -
Method Summary
Modifier and TypeMethodDescriptiondefault TReturns the exception thrown in the test.static <T extends Throwable>
ActualException<T>of(T exception, boolean successful) Returns an instance representing behavior where the given exception was thrown or an behavior where no exception was thrown if no exception is given.static <T extends Throwable>
ActualException<T>Returns an instance representing behavior where the given exception was thrown or, if no exception is given, an behavior where no exception was thrown.Methods inherited from interface org.tudalgo.algoutils.tutor.general.assertions.actual.Actual
display, string, successfulMethods inherited from interface org.tudalgo.algoutils.tutor.general.assertions.actual.ActualObject
behavior, object
-
Field Details
-
DEFAULT_FORMATTER
A function enclosing an already enclosed type with default text.
-
-
Method Details
-
of
static <T extends Throwable> ActualException<T> of(T exception, boolean successful, Function<String, String> formatter) Returns an instance representing behavior where the given exception was thrown or, if no exception is given, an behavior where no exception was thrown.
- Type Parameters:
T- the type of the exception- Parameters:
exception- the exceptionformatter- the formatter- Returns:
- the exceptional behavior
-
of
Returns an instance representing behavior where the given exception was thrown or an behavior where no exception was thrown if no exception is given.
- Type Parameters:
T- the type of the exception- Parameters:
exception- the exception- Returns:
- the exceptional behavior
-
exception
Returns the exception thrown in the test.- Returns:
- the exception
-