Class BasicResult<RT extends Result<RT,AT,TT,ET>,AT extends Actual,TT extends Test<TT,ET,RT,AT>,ET extends Expected>
java.lang.Object
org.tudalgo.algoutils.tutor.general.assertions.basic.BasicResult<RT,AT,TT,ET>
- Type Parameters:
RT- the type of the resultAT- the type of the actual behaviorTT- the type of the testET- the type of the expected behavior
- All Implemented Interfaces:
Result<RT,AT, TT, ET>
- Direct Known Subclasses:
BasicResultOfCall,BasicResultOfExceptionalCall,BasicResultOfFail,BasicResultOfObject
public abstract class BasicResult<RT extends Result<RT,AT,TT,ET>,AT extends Actual,TT extends Test<TT,ET,RT,AT>,ET extends Expected>
extends Object
implements Result<RT,AT,TT,ET>
An abstract basic implementation of a test.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ATprotected final Environmentprotected final Exceptionprotected final TT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBasicResult(Environment environment, TT test, AT actual, Exception exception) Constructs a new result with the given environment, test, actual behavior, exception and state if the test was successful. -
Method Summary
Modifier and TypeMethodDescriptionactual()Returns the actual of this result.cause()If this result is not Result.successful() due to an exception, this method returns the causing exception.check(Context context, PreCommentSupplier<? super RT> preCommentSupplier) If this result is not successful, this method throws anAssertionFailedErrorinforming about the failure.test()Returns the test this result belongs to.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tudalgo.algoutils.tutor.general.assertions.Result
expected, successful
-
Field Details
-
environment
-
test
-
actual
-
exception
-
-
Constructor Details
-
BasicResult
Constructs a new result with the given environment, test, actual behavior, exception and state if the test was successful.- Parameters:
environment- the environmenttest- the testactual- the actual behaviorexception- the exception
-
-
Method Details
-
actual
Description copied from interface:ResultReturns the actual of this result.
If the test has failed due to an exception, the actual might be
nulland the exception trace can be retrieved usingResult.cause(). -
cause
Description copied from interface:ResultIf this result is not Result.successful() due to an exception, this method returns the causing exception. Otherwise null is returned.
-
check
Description copied from interface:ResultIf this result is not successful, this method throws an
AssertionFailedErrorinforming about the failure. -
test
Description copied from interface:ResultReturns the test this result belongs to.
-