ConnectorTester<St, Model> class

Helps testing the StoreConnectors methods, such as onInit, onDispose and onWillChange.

For more info, see: https://pub.dartlang.org/packages/async_redux

Example: Suppose you have a StoreConnector which dispatches SomeAction on its onInit. How could you test that?

class MyConnector extends StatelessWidget {
  Widget build(BuildContext context) => StoreConnector<AppState, Vm>(
        vm: () => _Factory(),
        onInit: _onInit,
        builder: (context, vm) { ... }
  }

  void _onInit(Store<AppState> store) => store.dispatch(SomeAction());
}

var storeTester = StoreTester(...);
ConnectorTester(tester, MyConnector()).runOnInit();
var info = await tester.waitUntil(SomeAction);

Constructors

ConnectorTester(StoreTester<St> tester, StatelessWidget widgetConnector)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storeConnector StoreConnector<St, Model>
no setter
tester StoreTester<St>
final
widgetConnector StatelessWidget
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runOnDispose() → void
runOnInit() → void
runOnWillChange(Model previousVm, Model newVm) → void
toString() String
A string representation of this object.
inherited

Operators

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