Arbitrary<T> class abstract

Components that generate data and perform shrinking, which are especially crucial elements in property-based testing.

Constructors

Arbitrary()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

cast<U>() → Arbitrary<U>
Returns an arbitrary that casts the generated values to type U.
example({RandomState? state, bool edgeCase = false}) → T
Generates an example of the data.
filter(bool predicate(T)) → Arbitrary<T>
Returns an arbitrary that filters examples.
flatMap<U>(Arbitrary<U> f(T)) → Arbitrary<U>
Returns an arbitrary from examples.
map<U>(U f(T)) → Arbitrary<U>
Returns an arbitrary that transforms examples.
nonEmpty() → Arbitrary<T>
Returns an arbitrary that generates non-empty values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited