setup static method

void setup(
  1. TestFirebaseAppHostApi? api, {
  2. BinaryMessenger? binaryMessenger,
})

Implementation

static void setup(TestFirebaseAppHostApi? api,
    {BinaryMessenger? binaryMessenger}) {
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      _testBinaryMessengerBinding!.defaultBinaryMessenger
          .setMockDecodedMessageHandler<Object?>(channel, null);
    } else {
      _testBinaryMessengerBinding!.defaultBinaryMessenger
          .setMockDecodedMessageHandler<Object?>(channel,
              (Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final String? arg_appName = (args[0] as String?);
        assert(arg_appName != null,
            'Argument for dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled was null, expected non-null String.');
        final bool? arg_enabled = (args[1] as bool?);
        assert(arg_enabled != null,
            'Argument for dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticDataCollectionEnabled was null, expected non-null bool.');
        await api.setAutomaticDataCollectionEnabled(
            arg_appName!, arg_enabled!);
        return <Object?>[];
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled',
        codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      _testBinaryMessengerBinding!.defaultBinaryMessenger
          .setMockDecodedMessageHandler<Object?>(channel, null);
    } else {
      _testBinaryMessengerBinding!.defaultBinaryMessenger
          .setMockDecodedMessageHandler<Object?>(channel,
              (Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final String? arg_appName = (args[0] as String?);
        assert(arg_appName != null,
            'Argument for dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled was null, expected non-null String.');
        final bool? arg_enabled = (args[1] as bool?);
        assert(arg_enabled != null,
            'Argument for dev.flutter.pigeon.FirebaseAppHostApi.setAutomaticResourceManagementEnabled was null, expected non-null bool.');
        await api.setAutomaticResourceManagementEnabled(
            arg_appName!, arg_enabled!);
        return <Object?>[];
      });
    }
  }
  {
    final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
        'dev.flutter.pigeon.FirebaseAppHostApi.delete', codec,
        binaryMessenger: binaryMessenger);
    if (api == null) {
      _testBinaryMessengerBinding!.defaultBinaryMessenger
          .setMockDecodedMessageHandler<Object?>(channel, null);
    } else {
      _testBinaryMessengerBinding!.defaultBinaryMessenger
          .setMockDecodedMessageHandler<Object?>(channel,
              (Object? message) async {
        assert(message != null,
            'Argument for dev.flutter.pigeon.FirebaseAppHostApi.delete was null.');
        final List<Object?> args = (message as List<Object?>?)!;
        final String? arg_appName = (args[0] as String?);
        assert(arg_appName != null,
            'Argument for dev.flutter.pigeon.FirebaseAppHostApi.delete was null, expected non-null String.');
        await api.delete(arg_appName!);
        return <Object?>[];
      });
    }
  }
}