createForTest static method

  1. @visibleForTesting
SoraConnection createForTest({
  1. required SoraConnectionConfig config,
  2. required int clientId,
  3. 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,
  );
}