public final class CheckResult
extends java.lang.Object
CheckResult
may
be in one of six states:
Modifier and Type | Field and Description |
---|---|
static Show<CheckResult> |
summary
A rendering of a check result that summarises in one line.
|
static Show<CheckResult> |
summaryEx
A rendering of a check result that summarises in one line but throws an exception in the result
is a failure (falsified, property exception or generator exception).
|
Modifier and Type | Method and Description |
---|---|
Option<List<Arg<?>>> |
args()
Returns the arguments if the result is one of; proven, falsified or exception during property
execution, otherwise, no arguments are returned.
|
int |
discarded()
Returns the number of discarded checks of the property in this result.
|
Option<java.lang.Throwable> |
exception()
Returns the execption if the result is one of; exception during property execution or exception
during argument value generation, otherwise, no exception are returned.
|
static CheckResult |
exhausted(int succeeded,
int discarded)
Returns a result that the property been exhausted in checking.
|
static CheckResult |
falsified(List<Arg<?>> args,
int succeeded,
int discarded)
Returns a result that the property has been falsified.
|
static CheckResult |
genException(java.lang.Throwable ex,
int succeeded,
int discarded)
Returns a result that generating values to check the property threw an exception.
|
boolean |
isExhausted()
Returns
true if this result is exhausted, false otherwise. |
boolean |
isFalsified()
Returns
true if this result is falsified, false otherwise. |
boolean |
isGenException()
Returns
true if this result is an exception during generating of values for
property checking, false otherwise. |
boolean |
isPassed()
Returns
true if this result is passed, false otherwise. |
boolean |
isPropException()
Returns
true if this result is an exception during property execution,
false otherwise. |
boolean |
isProven()
Returns
true if this result is proven, false otherwise. |
static CheckResult |
passed(int succeeded,
int discarded)
Returns a result that the property has passed.
|
static CheckResult |
propException(List<Arg<?>> args,
java.lang.Throwable ex,
int succeeded,
int discarded)
Returns a result that checking the property threw an exception.
|
static CheckResult |
proven(List<Arg<?>> args,
int succeeded,
int discarded)
Returns a result that the property has been proven.
|
int |
succeeded()
Returns the number of succeeded checks of the property in this result.
|
static Show<CheckResult> |
summary(Show<Arg<?>> sa)
A rendering of a check result that summarises in one line.
|
static Show<CheckResult> |
summaryEx(Show<Arg<?>> sa)
A rendering of a check result that summarises in one line but throws an exception in the result
is a failure (falsified, property exception or generator exception).
|
public static final Show<CheckResult> summary
public static final Show<CheckResult> summaryEx
public static CheckResult passed(int succeeded, int discarded)
succeeded
- The number of checks that succeeded.discarded
- The number of checks that were discarded.public static CheckResult proven(List<Arg<?>> args, int succeeded, int discarded)
args
- The arguments used to prove the property.succeeded
- The number of checks that succeeded.discarded
- The number of checks that were discarded.public static CheckResult falsified(List<Arg<?>> args, int succeeded, int discarded)
args
- The arguments used to falsify the property.succeeded
- The number of checks that succeeded.discarded
- The number of checks that were discarded.public static CheckResult exhausted(int succeeded, int discarded)
succeeded
- The number of checks that succeeded.discarded
- The number of checks that were discarded.public static CheckResult propException(List<Arg<?>> args, java.lang.Throwable ex, int succeeded, int discarded)
args
- The arguments used when the exception was thrown.ex
- The exception that was thrown.succeeded
- The number of checks that succeeded.discarded
- The number of checks that were discarded.public static CheckResult genException(java.lang.Throwable ex, int succeeded, int discarded)
ex
- The exception that was thrown.succeeded
- The number of checks that succeeded.discarded
- The number of checks that were discarded.public boolean isPassed()
true
if this result is passed, false
otherwise.true
if this result is passed, false
otherwise.public boolean isProven()
true
if this result is proven, false
otherwise.true
if this result is proven, false
otherwise.public boolean isFalsified()
true
if this result is falsified, false
otherwise.true
if this result is falsified, false
otherwise.public boolean isExhausted()
true
if this result is exhausted, false
otherwise.true
if this result is exhausted, false
otherwise.public boolean isPropException()
true
if this result is an exception during property execution,
false
otherwise.true
if this result is an exception during property execution,
false
otherwise.public boolean isGenException()
true
if this result is an exception during generating of values for
property checking, false
otherwise.true
if this result is an exception during generating of values for
property checking, false
otherwise.public Option<List<Arg<?>>> args()
public Option<java.lang.Throwable> exception()
public int succeeded()
public int discarded()
public static Show<CheckResult> summary(Show<Arg<?>> sa)
sa
- The rendering of arguments.public static Show<CheckResult> summaryEx(Show<Arg<?>> sa)
sa
- The rendering of arguments.