BasicResult

public abstract class BasicResult<RT extends Result<RT, AT, TT, ET>, AT extends Actual, TT extends Test<TT, ET, RT, AT>, ET extends Expected> implements Result<RT, AT, TT, ET>(source)

An abstract basic implementation of a test.

Author

Dustin Glaser

Parameters

<TT>

the type of the test

<ET>

the type of the expected behavior

<RT>

the type of the result

<AT>

the type of the actual behavior

Inheritors

Constructors

Link copied to clipboard
protected void BasicResult(Environment environment, TT test, AT actual, Throwable exception)
Constructs a new result with the given environment, test, actual behavior, exception and state if the test was successful.

Types

Link copied to clipboard
public abstract class Builder<RT extends Result<RT, AT, TT, ET>, AT extends Actual, TT extends Test<TT, ET, RT, AT>, ET extends Expected, BT extends Result.Builder<RT, AT, TT, ET, BT>> implements Result.Builder<RT, AT, TT, ET, BT>

Properties

Link copied to clipboard
protected final AT actual
Link copied to clipboard
protected final Environment environment
Link copied to clipboard
protected final Throwable exception
Link copied to clipboard
protected final TT test

Functions

Link copied to clipboard
public AT actual()
Returns the actual of this result.
Link copied to clipboard
public Throwable cause()
If this result is not successful due to an exception, this method returns the causing exception.
Link copied to clipboard
public RT check(Context context, PreCommentSupplier<? super RT> preCommentSupplier)
If this result is not successful, this method throws an AssertionFailedError informing about the failure.
Link copied to clipboard
public ET expected()
Returns the expected behavior of this result.
Link copied to clipboard
public boolean successful()
Returns if the test was successful.
Link copied to clipboard
public TT test()
Returns the test this result belongs to.