doc / ch.tutteli.atrium.logic.creating.basic.contains.checkers.impl / ContainsChecker

ContainsChecker

abstract class ContainsChecker : Contains.Checker

Represents a base class for Contains.Checkers which compare how many occurrences of an expected object are found in the input of the search, against how many times the check expect it to be contained.

It further checks that times is bigger than 0 (throws an IllegalArgumentException otherwise) and additionally suggest to use a different function if times equals to zero.

Constructors

<init>

ContainsChecker(times: Int, correctCall: String, wrongCall: (Int) -> String)

Represents a base class for checkers which compare how many occurrences of an expected object are found in the input of the search, against how many times the check expect it to be contained.

Properties

times

val times: Int

The number which the check uses to compare against the actual number of times an expected object is found in the input of the search.

Functions

createDescriptiveAssertion

fun createDescriptiveAssertion(description: Translatable, check: () -> Boolean): DescriptiveAssertion

Creates a DescriptiveAssertion based on the given description, the property times as Text and the given check.

Inherited Functions

createAssertion

abstract fun createAssertion(foundNumberOfTimes: Int): Assertion

Creates an Assertion representing this check based on the given foundNumberOfTimes which is the result of the search.

Inheritors

DefaultAtLeastChecker

class DefaultAtLeastChecker : AtLeastChecker, ContainsChecker

Represents a check that an expected search criterion is contained at least times in the search input.

DefaultAtLeastChecker

class DefaultAtLeastChecker : AtLeastChecker, ContainsChecker

Represents a check that an expected entry is contained at least times in the Iterable.

DefaultAtMostChecker

class DefaultAtMostChecker : AtMostChecker, ContainsChecker

Represents a check that an expected search criterion is contained at most times in the search input.

DefaultAtMostChecker

class DefaultAtMostChecker : AtMostChecker, ContainsChecker

Represents a check that an expected entry is contained at most times in the Iterable.

DefaultExactlyChecker

class DefaultExactlyChecker : ExactlyChecker, ContainsChecker

Represents a check that an expected search criterion is contained exactly times in the search input.

DefaultExactlyChecker

class DefaultExactlyChecker : ExactlyChecker, ContainsChecker

Represents a check that an expected entry is contained exactly times in the Iterable.