ObjectAssertions class

Contains a number of methods to assert that a Object is in the expected state.

Inheritance

Constructors

ObjectAssertions(Object? subject, {bool isReversed = false, String? subjectLabel})
Initializes a new instance of the ObjectAssertions class.

Properties

and → ObjectAssertions
Bind assertions
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
isReversed → bool
Checking reverse
finalinherited
not → ObjectAssertions
Invert assertion
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subject → Object?
the object which value is being asserted.
finalinherited
subjectLabel → String
Friendly label for the subject object
no setterinherited

Methods

as(String subjectLabel) → ObjectAssertions
Set friendly title for the subject
inherited
be(Object expected) → ObjectAssertions
Asserts that the value is equal to the specified expected value. expected The expected value
inherited
beAssignableTo<U>() → U?
Asserts that the object is assignable to a variable of type U
inherited
beNull() → ObjectAssertions
Asserts that the object is not null
inherited
beOfType<U>() → U?
Asserts that the object is not of the specified type U
inherited
beOneOf(Iterable<Object> validItems) → ObjectAssertions
Asserts that a value is one of the specified validItems
inherited
copy(Object? subject, {bool isReversed = false, String? subjectLabel}) → ObjectAssertions
Copy the matcher
override
isEqual(Object expected) → bool
Comparison with an another expected value
inherited
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