PluginTestHost class final

A plugin host for a test: a PluginManager over a TestLoop, a TestEvents and a TestComponents that write down what a plugin registers, beside the engine's registries a test hands it.

The fake the engine keeps compiling. The registries in this package are implemented by the engine: a call grows by an optional named parameter in a minor, which breaks a class outside the engine that extends one, as LoopRegistry.addSystem's reads: and writes: did. A test that needs a loop or a bus without the engine's uses these, and the engine adds every parameter to them in the same release.

final host = PluginTestHost(registries: [renderer.renderSteps]);
host.install([const GlowPlugin()]);
expect(host.loop.systems.keys, contains('acme_glow.fade'));

Constructors

PluginTestHost({Iterable<PluginRegistry> registries = const <PluginRegistry>[], String? backend, SimulationProfile profile = SimulationProfile.deterministic})
A host over fresh fakes, with registries beside them, drawing with backend (none by default, as a server's) under profile.
factory

Properties

components → TestComponents
The component codecs the plugins added.
final
events → TestEvents
The events the plugins declared, subscribed to and published.
final
hashCode → int
The hash code for this object.
no setterinherited
loop → TestLoop
The phases and systems the plugins added.
final
manager → PluginManager
The host itself: versions, order, switching.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
snapshots → TestSnapshots
The snapshot parts the plugins added, which host.registry<SnapshotRegistry>() finds unless the test handed a registry of its own.
final

Methods

install(Iterable<Flutter3dPlugin> plugins) → PluginManager
Installs plugins, as PluginManager.installAll does, and answers manager for what a test asks of it next.
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