Returns a matcher that matches if an object is an instance
of type (or a subtype).
As types are not first class objects in Dart we can only approximate this test by using a generic wrapper class.
For example, to test whether 'bar' is an instance of type 'Foo', we would write:
expect(bar, new isInstanceOf<Foo>());
Constructors
- isInstanceOf()
-
const
Properties
- hashCode → int
-
Get a hash code for this object.
read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
describe(
Description description) → Description -
This builds a textual description of the matcher.
-
matches(
obj, Map matchState) → bool -
This does the matching of the actual vs expected values.
itemis the actual value.matchStatecan be supplied and may be used to add details about the mismatch that are too costly to determine indescribeMismatch. -
describeMismatch(
item, Description mismatchDescription, Map matchState, bool verbose) → Description -
This builds a textual description of a specific mismatch.
itemis the value that was tested by matches;matchStateis the Map that was passed to and supplemented by matches with additional information about the mismatch, andmismatchDescriptionis the Description that is being built to decribe the mismatch. A few matchers make use of theverboseflag to provide detailed information that is not typically included but can be of help in diagnosing failures, such as stack traces.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited