Class TestDataBase<E>

java.lang.Object
org.tquadrat.foundation.testutil.TestDataBase<E>
Type Parameters:
E - The type of the expected result.
All Implemented Interfaces:
Serializable

@API(status=STABLE, since="0.0.5") public abstract class TestDataBase<E> extends Object implements Serializable
This class is meant as the base class for test data records.
Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: TestDataBase.java 820 2020-12-29 20:34:22Z tquadrat $
Since:
0.1.0
See Also:
UML Diagram
UML Diagram for "org.tquadrat.foundation.testutil.TestDataBase"

UML Diagram for "org.tquadrat.foundation.testutil.TestDataBase"

UML Diagram for "org.tquadrat.foundation.testutil.TestDataBase"
  • Field Details

  • Constructor Details

    • TestDataBase

      protected TestDataBase(E expected)
      Creates a new TestDataBase instance.
      Parameters:
      expected - The expected result for the test; if null the test should fail.
    • TestDataBase

      protected TestDataBase(E expected, String description)
      Creates a new TestDataBase instance.
      Parameters:
      expected - The expected result for the test; if null the test should fail.
      description - The description for this test.
  • Method Details

    • description

      public final Optional<String> description()
      Returns the description for the test.
      Returns:
      An instance of Optional that holds the description.
    • expected

      public final Optional<E> expected()
      Returns the expected result for the test. An empty return value indicates that the test should fail.
      Returns:
      An instance of Optional that holds the expected result.
    • shouldFail

      public final boolean shouldFail()
      Indicates whether the test should fail.
      Returns:
      true if the test should fail, false if it should be successful.