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 property
    • Falsified, if a counter-example could be discovered that falsified the given property
    • Erroneous, if an exception occurred executing the property check
    Please note that a 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).
    • 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.