TestClient class final
A real ConfigDirectorClient together with the controls that decide what its in-memory server delivers.
Create one with createTestClient. Value changes reach the client the way
a server update does, so watch streams, onConfigsUpdated, and reads all
reflect them. Deliveries arrive asynchronously: await pumpEventQueue() in
a test, or await tester.pump() in a testWidgets, before asserting.
Properties
- client → ConfigDirectorClient
-
The SDK client under test. Pass it wherever production code accepts a
ConfigDirectorClient, and dispose it as production code would.
no setter
-
contextUpdates
→ List<
ConfigDirectorContext> -
The context of every
initializeandupdateContextcall, in call order.initializewithout a context records an empty context.resumeNetworkis not recorded.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
completeContextUpdate(
) → void -
Delivers the stored values to a held
updateContext, which then completes with the client ready. Called while a hold is armed but noupdateContexthas picked it up, it disarms the hold. -
completeInitialization(
) → void -
Delivers the stored values to a held
initialize, which then completes with the client ready. Called while a hold is armed but noinitializehas picked it up, it disarms the hold. -
failContextUpdate(
) → void -
Fails a held
updateContextthe way an invalid SDK key does: it completes promptly, the client is not ready, and an error is logged. Called while noupdateContextis held, it arms the next one to fail. -
failInitialization(
) → void -
Fails a held
initializethe way an invalid SDK key does: it completes promptly, the client is not ready, and an error is logged. Called while noinitializeis held, it arms the next one to fail. -
holdContextUpdate(
) → void -
Makes the next
updateContextwait, not ready, until completeContextUpdate or failContextUpdate, or until the client's timeout elapses. -
holdInitialization(
) → void -
Makes the next
initializewait, not ready, until completeInitialization or failInitialization, or until the client's timeout elapses. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeValue(
String key) → void -
Removes the value under
keyand, once the client is connected, delivers a full update without it, sokeyreads as its in-code default value. -
replaceValues(
Map< String, Object?> values) → void -
Replaces every stored value with
values, disarms any armed hold or failure, and, once the client is connected, delivers a full update. Use it to reset a test client shared across tests. -
setValue(
String key, Object? value) → void -
Stores
valueunderkeyand, once the client is connected, delivers an update carrying onlykey. See createTestClient for the accepted values. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited