Class NormalResult<R>

java.lang.Object
org.tudalgo.algoutils.tutor.general.call.NormalResult<R>
Type Parameters:
R - the type of expected result
All Implemented Interfaces:
Call<R>

public class NormalResult<R> extends Object implements Call<R>
An instance of NormalResult represents a call that resulted in no exception.
  • Constructor Details

    • NormalResult

      public NormalResult(R result)
  • Method Details

    • assertThrows

      public <T extends Throwable> T assertThrows(Class<T> type, Supplier<String> messageSupplier) throws org.opentest4j.AssertionFailedError
      Description copied from interface: Call
      Asserts that the call resulted in a throwable of type type and returns the throwable. Otherwise, an AssertionFailedError containing the message supplied by messageSupplier will be thrown.
      messageSupplier is allowed to supply null.
      Specified by:
      assertThrows in interface Call<R>
      Type Parameters:
      T - the type of the expected throwable
      Parameters:
      type - the type of the expected throwable
      messageSupplier - a supplier for the message if the throwable was not thrown
      Returns:
      the throwable resulted by the call
      Throws:
      org.opentest4j.AssertionFailedError - if the call did not result in a throwable of type type
      See Also:
    • assertNormal

      public R assertNormal(Supplier<String> messageSupplier) throws org.opentest4j.AssertionFailedError
      Description copied from interface: Call
      Asserts that the call resulted in a result of type type and returns the result. Otherwise, an AssertionFailedError containing the message supplied by messageSupplier will be thrown.
      messageSupplier is allowed to supply null.
      Specified by:
      assertNormal in interface Call<R>
      Parameters:
      messageSupplier - a supplier for the message if the throwable was not thrown
      Returns:
      the result resulted by the call
      Throws:
      org.opentest4j.AssertionFailedError - if the call resulted in a throwable