UnitTestHarness class abstract base

class to subclass for any test that does not take a WidgetTester use HarnessSetup.setupHarness to create a harness then pass it into the body of a test


 test('myTest', unitTestHarness((given,when,then) async {}))
final unitTestHarness = HarnessSetup.setupHarness(MyHarness.new);

class MyHarness extends UnitTestHarness {

}
Inheritance

Constructors

UnitTestHarness()

Properties

commonTestHelper CommonTester
abstraction so mixins can be written to support dart tests and widget tests uses pump, pumpAndSettle, and idle in widget tests. Uses Future.value and Future.microtask for unit tests
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setup() Future<void>
Used so mixins can setup testing infrastructure see SemanticTesterMixin for example
inherited
setupWidgetTree(Widget child) Widget
Allows mixins to add appropriate widgets if needed.
inherited
setupZones(Future<void> child()) Future<void>
used to wrap callback with runZoned or other test helpers that take a function. see NetworkImageMixin for example of setup.
inherited
teardown() Future<void>
Used so mixins can teardown testing infrastructure see SemanticTesterMixin for example
inherited
toString() String
A string representation of this object.
inherited

Operators

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