InfoRule

Functions

Link copied to clipboard
fun contact(description: String = "", rule: ContactRule.() -> ContactRule): InfoRule
Link copied to clipboard
fun description(description: String = "", rule: StringRule.() -> StringRule): InfoRule
Link copied to clipboard
fun <R : ValidationRule<Info>> R.either(vararg option: Info): R

Validate that the element should be equal to one of the elements in option given that it is set.

Link copied to clipboard
fun <R : ValidationRule<Info>> R.exactly(value: Info): R

Validate that the element should be equal to value given that it is set.

Link copied to clipboard
fun <R : ValidationRule<Info>> R.given(precondition: (Info?) -> Boolean, rule: R.() -> R): R

Validate rule only if precondition evaluates to true.

Link copied to clipboard
fun <R : ValidationRule<Info>> R.holds(message: (Info?) -> String = { "Was supposed to hold for '$it' but did not" }, predicate: (Info?) -> Boolean): R

Validate that predicate evaluates to true.

Link copied to clipboard
fun licence(description: String = "", rule: LicenceRule.() -> LicenceRule): InfoRule
Link copied to clipboard
fun <R : ValidationRule<Info>> R.not(message: String, rule: R.() -> R): R

Validate that the rule does not hold.

Link copied to clipboard
fun <V, R : ValidationRule<Info>> R.optional(value: (Info?) -> V?, rule: R.() -> R): R

Validate rule only if the evaluated result of value is not null.

Link copied to clipboard
fun <R : ValidationRule<Info>> R.required(): R

Validate that the element is set.

Link copied to clipboard
fun <R : ValidationRule<Info>> R.since(date: LocalDate, rule: R.() -> R): R

Validate rule only if date has been in the past.

Link copied to clipboard
fun summary(description: String = "", rule: StringRule.() -> StringRule): InfoRule
Link copied to clipboard
fun termsOfService(description: String = "", rule: StringRule.() -> StringRule): InfoRule
Link copied to clipboard
fun title(description: String = "", rule: StringRule.() -> StringRule): InfoRule
Link copied to clipboard
fun <R : ValidationRule<Info>> R.unspecified(): R

Validate that the element is not set.

Link copied to clipboard
fun validate(fixture: Info?): ValidationResult

Execute the given rule(s) on the fixture.

Link copied to clipboard
fun version(description: String = "", rule: StringRule.() -> StringRule): InfoRule