/// GENERATED BY testcase_gen. DO NOT MODIFY BY HAND.

// ignore_for_file: deprecated_member_use,constant_identifier_names

import 'package:agora_rtc_engine/agora_rtc_engine.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/foundation.dart';
import 'package:fake_test_app/main.dart' as app;
import 'package:iris_tester/iris_tester.dart';
import 'package:iris_method_channel/iris_method_channel.dart';

void musicContentCenterSmokeTestCases() {
  testWidgets(
    'MusicContentCenter.initialize',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        String configurationAppId = "hello";
        String configurationToken = "hello";
        int configurationMccUid = 5;
        int configurationMaxCacheSize = 5;
        String configurationMccDomain = "hello";
        MusicContentCenterConfiguration configuration =
            MusicContentCenterConfiguration(
          appId: configurationAppId,
          token: configurationToken,
          mccUid: configurationMccUid,
          maxCacheSize: configurationMaxCacheSize,
          mccDomain: configurationMccDomain,
        );
        await musicContentCenter.initialize(
          configuration,
        );
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint('[MusicContentCenter.initialize] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.renewToken',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        String token = "hello";
        await musicContentCenter.renewToken(
          token,
        );
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint('[MusicContentCenter.renewToken] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.release',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        await musicContentCenter.release();
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint('[MusicContentCenter.release] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.registerEventHandler',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        MusicContentCenterEventHandler eventHandler =
            MusicContentCenterEventHandler(
          onMusicChartsResult: (String requestId, List result,
              MusicContentCenterStateReason reason) {},
          onMusicCollectionResult: (String requestId, MusicCollection result,
              MusicContentCenterStateReason reason) {},
          onLyricResult: (String requestId, int songCode, String lyricUrl,
              MusicContentCenterStateReason reason) {},
          onSongSimpleInfoResult: (String requestId, int songCode,
              String simpleInfo, MusicContentCenterStateReason reason) {},
          onPreLoadEvent: (String requestId,
              int songCode,
              int percent,
              String lyricUrl,
              PreloadState state,
              MusicContentCenterStateReason reason) {},
        );
        musicContentCenter.registerEventHandler(
          eventHandler,
        );
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint(
              '[MusicContentCenter.registerEventHandler] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.unregisterEventHandler',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        musicContentCenter.unregisterEventHandler();
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint(
              '[MusicContentCenter.unregisterEventHandler] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.getMusicCharts',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        await musicContentCenter.getMusicCharts();
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint(
              '[MusicContentCenter.getMusicCharts] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.getMusicCollectionByMusicChartId',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        int musicChartId = 5;
        int page = 5;
        int pageSize = 5;
        String jsonOption = "hello";
        await musicContentCenter.getMusicCollectionByMusicChartId(
          musicChartId: musicChartId,
          page: page,
          pageSize: pageSize,
          jsonOption: jsonOption,
        );
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint(
              '[MusicContentCenter.getMusicCollectionByMusicChartId] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.searchMusic',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        String keyWord = "hello";
        int page = 5;
        int pageSize = 5;
        String jsonOption = "hello";
        await musicContentCenter.searchMusic(
          keyWord: keyWord,
          page: page,
          pageSize: pageSize,
          jsonOption: jsonOption,
        );
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint('[MusicContentCenter.searchMusic] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.preload',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        int songCode = 5;
        await musicContentCenter.preload(
          songCode,
        );
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint('[MusicContentCenter.preload] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.removeCache',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        int songCode = 5;
        await musicContentCenter.removeCache(
          songCode,
        );
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint('[MusicContentCenter.removeCache] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.getCaches',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        int cacheInfoSize = 5;
        await musicContentCenter.getCaches(
          cacheInfoSize,
        );
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint('[MusicContentCenter.getCaches] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.isPreloaded',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        int songCode = 5;
        await musicContentCenter.isPreloaded(
          songCode,
        );
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint('[MusicContentCenter.isPreloaded] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.getLyric',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        int songCode = 5;
        int lyricType = 5;
        await musicContentCenter.getLyric(
          songCode: songCode,
          lyricType: lyricType,
        );
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint('[MusicContentCenter.getLyric] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.getSongSimpleInfo',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        int songCode = 5;
        await musicContentCenter.getSongSimpleInfo(
          songCode,
        );
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint(
              '[MusicContentCenter.getSongSimpleInfo] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );

  testWidgets(
    'MusicContentCenter.getInternalSongCode',
    (WidgetTester tester) async {
      String engineAppId = const String.fromEnvironment('TEST_APP_ID',
          defaultValue: '<YOUR_APP_ID>');

      RtcEngine rtcEngine = createAgoraRtcEngine();
      await rtcEngine.initialize(RtcEngineContext(
        appId: engineAppId,
        areaCode: AreaCode.areaCodeGlob.value(),
      ));
      await rtcEngine.setParameters('{"rtc.enable_debug_log": true}');

      final musicContentCenter = rtcEngine.getMusicContentCenter();

      try {
        int songCode = 5;
        String jsonOption = "hello";
        await musicContentCenter.getInternalSongCode(
          songCode: songCode,
          jsonOption: jsonOption,
        );
      } catch (e) {
        if (e is! AgoraRtcException) {
          debugPrint(
              '[MusicContentCenter.getInternalSongCode] error: ${e.toString()}');
          rethrow;
        }

        if (e.code != -4) {
          // Only not supported error supported.
          rethrow;
        }
      }

      await musicContentCenter.release();
      await rtcEngine.release();
    },
//  skip: !(),
  );
}
