import 'package:flutter_test/flutter_test.dart';
import 'package:smplayer/core/contracts/trakt/trakt_ids.dart';

void main() {
  test('fromJson 统一解析 Trakt 外部 ID', () {
    final ids = TraktIds.fromJson({
      'trakt': 1.0,
      'imdb': 'tt123',
      'tmdb': 2,
      'tvdb': 3.0,
      'slug': 'demo',
    });

    expect(ids.toJson(), {
      'trakt': 1,
      'imdb': 'tt123',
      'tmdb': 2,
      'tvdb': 3,
      'slug': 'demo',
    });
    expect(TraktIds.fromJson(null).toJson(), isEmpty);
  });
}
