A matcher over com.wix.accord.GroupViolations.
A matcher over com.wix.accord.GroupViolations. To generate a violation rule "pattern", call the constructor with the required predicates, for example:
val firstNameNotEmpty =
RuleViolationMatcher( description = AccessChain( "firstName" ), constraint = "must not be empty" )
val lastNameNotEmpty =
RuleViolationMatcher( description = AccessChain( "lastName" ), constraint = "must not be empty" )
val orPredicateFailed =
GroupViolationMatcher( constraint = "doesn't meet any of the requirements",
violations = firstNameNotEmpty :: lastNameNotEmpty :: Nil )
val validationResult: Result = ...
validationResult must failWith( orPredicateFailed )
A predicate specifying the object under validation.
A predicate specifying the constraint being violated.
Retained for backwards compatibility; matches against the rendered description of the object being validated. See com.wix.accord.Descriptions.render for details of how descriptions are rendered into strings.
A predicate specifying the description of the object being validated.
The set of violations that comprise the group being validated.
com.wix.accord.GroupViolation
A matcher over validation com.wix.accord.Results.
A matcher over validation com.wix.accord.Results. Takes a set of expected violations and return a suitable match result in case of failure.
The set of expected violations for this matcher.
A matcher over com.wix.accord.RuleViolations.
A matcher over com.wix.accord.RuleViolations. To generate a violation rule "pattern", call the constructor with the required predicates, for example:
val firstNameNotEmpty =
RuleViolationMatcher( description = AccessChain( "firstName" ), constraint = "must not be empty" )
val validationResult: Result = ...
validationResult must failWith( firstNameNotEmpty )
A predicate specifying the object under validation.
A predicate specifying the constraint being violated.
Retained for backwards compatibility; matches against the rendered description of the object being validated. See com.wix.accord.Descriptions.render for details of how descriptions are rendered into strings.
A predicate specifying the description of the object being validated.
com.wix.accord.RuleViolation
Abstracts over validators for the various violation type.
Enables syntax like someResult should be( aFailure )
Enables syntax like someResult should be( aSuccess )
A convenience implicit to simplify test code.
A convenience implicit to simplify test code. Enables syntax like:
val rule: RuleViolationMatcher = AccessChain( "firstName" ) -> "must not be empty"
// ... which is equivalent to
val rule = RuleViolationMatcher( description = AccessChain( "firstName" ), constraint = "must not be empty" )
A convenience method for matching failures.
A convenience method for matching failures. Enables syntax like:
val result: Result = ...
result should failWith(
AccessChain( "firstName" ) -> "must not be empty",
AccessChain( "lastName" ) -> "must not be empty"
)
The set of expected violations.
A matcher over validation com.wix.accord.Results.
A convenience method for matching violation groups.
A convenience method for matching violation groups. Enables syntax like:
val result: Result = ...
result should failWith( group( AccessChain( "teacher" ), "is invalid", // The group context
AccessChain( "firstName ) -> "must not be empty" ) ) // The rule violations
A predicate specifying the description of the object being validated.
A textual description of the constraint being violated (for example, "must not be empty").
The set of expected violations that comprise the group.
A matcher over com.wix.accord.GroupViolations.
(Since version 0.6) Intended for backwards compatibility. It is recommended to match against Description types instead.
A convenience method for matching violation groups.
A convenience method for matching violation groups. Enables syntax like:
val result: Result = ...
result should failWith( group( AccessChain( "teacher" ), "is invalid", // The group context
AccessChain( "firstName ) -> "must not be empty" ) ) // The rule violations
Retained for backwards compatibility; matches against the rendered description of the object being validated. See com.wix.accord.Descriptions.render for details of how descriptions are rendered into strings.
A textual description of the constraint being violated (for example, "must not be empty").
The set of expected violations that comprise the group.
A matcher over com.wix.accord.GroupViolations.
(Since version 0.6) Intended for backwards compatibility. It is recommended to match against Description types instead.
A convenience implicit to simplify test code.
A convenience implicit to simplify test code. Enables syntax like:
val rule: RuleViolationMatcher = "firstName" -> "must not be empty"
// ... which is equivalent to
val rule = RuleViolationMatcher( legacyDescription = "firstName", constraint = "must not be empty" )
(Since version 0.6)
Extends a test suite with a set of matchers over validation com.wix.accord.Results.