Package io.vavr.test
Interface CheckResult
- All Known Implementing Classes:
CheckResult.Erroneous
,CheckResult.Falsified
,CheckResult.Satisfied
public interface CheckResult
Represents the result of a property check which is
Satisfied
, if all tests satisfied the given propertyFalsified
, if a counter-example could be discovered that falsified the given propertyErroneous
, if an exception occurred executing the property check
Satisfied
property check may be Exhausted
, if the property is an implication
and no sample could be found that satisfied the pre-condition. In this case the post-condition is satisfied by
definition (see ex falso quodlibet).-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Represents an erroneous property check.static class
Represents a falsified property check.static class
Represents a satisfied property check. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
Asserts that this CheckResult is erroneous.default void
Asserts that this CheckResult is falsified.default void
Asserts that this CheckResult is satisfied.default void
assertIsSatisfiedWithExhaustion
(boolean exhausted) Asserts that this CheckResult is satisfied with a given exhausted state.int
count()
The number of checks performed using random generated input data.error()
An optional error.boolean
If this check result is erroneous as specified above.boolean
If this check result is exhausted as specified above.boolean
If this check result is falsified as specified above.boolean
If this check result is satisfied as specified above.The name of the checked property this result refers to.sample()
An optional sample which falsified the property or which lead to an error.
-
Method Details
-
isSatisfied
boolean isSatisfied()If this check result is satisfied as specified above.- Returns:
- true, if this check result is satisfied, false otherwise
-
isFalsified
boolean isFalsified()If this check result is falsified as specified above.- Returns:
- true, if this check result is falsified, false otherwise
-
isErroneous
boolean isErroneous()If this check result is erroneous as specified above.- Returns:
- true, if this check result is erroneous, false otherwise
-
isExhausted
boolean isExhausted()If this check result is exhausted as specified above.- Returns:
- true, if this check result is exhausted, false otherwise
-
propertyName
String propertyName()The name of the checked property this result refers to.- Returns:
- a property name
-
count
int count()The number of checks performed using random generated input data.- Returns:
- the number of checks performed
-
sample
An optional sample which falsified the property or which lead to an error.- Returns:
- an optional sample
-
error
An optional error.- Returns:
- an optional error
-
assertIsSatisfied
default void assertIsSatisfied()Asserts that this CheckResult is satisfied.- Throws:
AssertionError
- if this CheckResult is not satisfied.
-
assertIsSatisfiedWithExhaustion
default void assertIsSatisfiedWithExhaustion(boolean exhausted) Asserts that this CheckResult is satisfied with a given exhausted state.- Parameters:
exhausted
- The exhausted state to be checked in the case of a satisfied CheckResult.- Throws:
AssertionError
- if this CheckResult is not satisfied or the exhausted state does not match.
-
assertIsFalsified
default void assertIsFalsified()Asserts that this CheckResult is falsified.- Throws:
AssertionError
- if this CheckResult is not falsified.
-
assertIsErroneous
default void assertIsErroneous()Asserts that this CheckResult is erroneous.- Throws:
AssertionError
- if this CheckResult is not erroneous.
-