StudentTestUtils

public class StudentTestUtils(source)

Utility class for tests written by students.

Constructors

Link copied to clipboard
public void StudentTestUtils()

Properties

Link copied to clipboard
public static PrintStream S_TEST_ERR
The PrintStream to use for test error output.
Link copied to clipboard
public static PrintStream S_TEST_OUT
The PrintStream to use for test output.
Link copied to clipboard
public static List<StudentTestResult<? extends Object>> testResults
The list of all test results created by the student tests.

Functions

Link copied to clipboard
public static void printTestResults()
Prints a summary of the test results to S_TEST_OUT.
Link copied to clipboard
public static void testEquals(Object expected, Object actual)
Checks that the given expected value is equal to the given actual value.
Link copied to clipboard
public static void testThrows<T extends Throwable>(Class<? extends Object> expectedType, Task task)
Checks if the given task throws an exception.
Link copied to clipboard
public static void testWithinRange<T extends Comparable<T>>(T min, T max, T actual)
public static void testWithinRange(double min, double max, double actual)
Checks that the given actual value is in the range [min, max].