
import 'package:naiyouwl/app/data/model/NodeMode.dart';
import 'package:test/test.dart';
import 'package:dart_json_mapper/dart_json_mapper.dart';
import 'package:naiyouwl/main.dart';
void main() {
  group('NodeMode tests', () {
    test('Convert JSON to YAML', () {
      var jsonData = '''[
        {
            "id": 908,
            "name": "香港原生61D",
            "host": "soca01.top",
            "group": "用户中心",
            "type": "trojan",
            "port": 443,
            "passwd": "VMhGp5wEIyCDf90T",
            "sni": "",
            "udp": 1,
            "ip": null,
            "online_users": 174,
            "country_code": "hk"
        },
        {
            "id": 871,
            "name": "马来西亚02",
            "host": "ncyidong.ip8000.top",
            "group": "用户中心",
            "type": "v2ray",
            "port": 29694,
            "uuid": "459b4a80-bd61-4ecd-a26b-e9c1809d9e45",
            "method": "auto",
            "v2_alter_id": 0,
            "v2_net": "tcp",
            "v2_type": "none",
            "v2_host": "",
            "v2_path": "/xej8pandp2augugy",
            "v2_tls": "",
            "v2_sni": "king-new04.xyz",
            "udp": 1,
            "vless": 1,
            "vless_pulkey": "qhTzYYIgBzDLNYR79oxftqdo1kzL-1_hGJKfqrOliCY",
            "ip": "38.60.194.62",
            "online_users": 10,
            "country_code": "fr"
        },

        {
            "id": 714,
            "name": "阿根廷02",
            "host": "ncyidong.ip8000.top",
            "group": "用户中心",
            "type": "shadowsocks",
            "method": "aes-128-gcm",
            "udp": 1,
            "port": 15464,
            "passwd": "VMhGp5wEIyCDf90T",
            "ip": "38.54.45.152",
            "online_users": 18,
            "country_code": "au"
        }
        ...
      ]'''; // 这里简化为省略号。请用你提供的完整JSON替换。

      // var nodes = JsonMapper.deserialize<List<NodeMode>>(jsonData)!;
      // var proxies = nodes.map(nodeToYaml).toList();
      //
      // // 这里我们只检查转换后的YAML是否为空，你可以根据需要添加更多具体的测试条件。
      // expect(proxies, isNotEmpty);
    });
  });
}
