createForTest static method
SoraConnection
createForTest({
- required SoraConnectionConfig config,
- required int clientId,
- required String eventChannelName,
テスト専用に MethodChannel を介さず SoraConnection を構築する。
internalCreate はプラットフォーム側の createClient を呼ぶため、
イベント処理のユニットテストでは FFI の WebrtcClient だけを使い
MethodChannel を迂回する。onEvent には internalCreate と同じ
unawaited + .catchError の安全網を設定する。
Implementation
@visibleForTesting
static SoraConnection createForTest({
required SoraConnectionConfig config,
required int clientId,
required String eventChannelName,
}) {
return _createWithOnEvent(
config: config,
clientId: clientId,
eventChannelName: eventChannelName,
);
}