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 isSatisfied
, 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 beExhausted
, 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 Classes Modifier and Type Interface Description static class
CheckResult.Erroneous
Represents an erroneous property check.static class
CheckResult.Falsified
Represents a falsified property check.static class
CheckResult.Satisfied
Represents a satisfied property check.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
assertIsErroneous()
Asserts that this CheckResult is erroneous.default void
assertIsFalsified()
Asserts that this CheckResult is falsified.default void
assertIsSatisfied()
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.Option<java.lang.Error>
error()
An optional error.boolean
isErroneous()
If this check result is erroneous as specified above.boolean
isExhausted()
If this check result is exhausted as specified above.boolean
isFalsified()
If this check result is falsified as specified above.boolean
isSatisfied()
If this check result is satisfied as specified above.java.lang.String
propertyName()
The name of the checked property this result refers to.Option<Tuple>
sample()
An optional sample which falsified the property or which lead to an error.
-
-
-
Method Detail
-
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
java.lang.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
Option<Tuple> sample()
An optional sample which falsified the property or which lead to an error.- Returns:
- an optional sample
-
error
Option<java.lang.Error> error()
An optional error.- Returns:
- an optional error
-
assertIsSatisfied
default void assertIsSatisfied()
Asserts that this CheckResult is satisfied.- Throws:
java.lang.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:
java.lang.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:
java.lang.AssertionError
- if this CheckResult is not falsified.
-
assertIsErroneous
default void assertIsErroneous()
Asserts that this CheckResult is erroneous.- Throws:
java.lang.AssertionError
- if this CheckResult is not erroneous.
-
-