import 'package:flutter_test/flutter_test.dart';
import 'package:superport/utils/currency_formatter.dart';

void main() {
  group('CurrencyFormatter Tests', () {
    test('formatKRW should format number with Korean won symbol and commas', () {
      expect(CurrencyFormatter.formatKRW(2000000), '₩2,000,000');
      expect(CurrencyFormatter.formatKRW(1000), '₩1,000');
      expect(CurrencyFormatter.formatKRW(100), '₩100');
      expect(CurrencyFormatter.formatKRW(0), '');
      expect(CurrencyFormatter.formatKRW(null), '');
    });

    test('parseKRW should extract numeric value from formatted string', () {
      expect(CurrencyFormatter.parseKRW('₩2,000,000'), 2000000);
      expect(CurrencyFormatter.parseKRW('₩1,000'), 1000);
      expect(CurrencyFormatter.parseKRW('₩100'), 100);
      expect(CurrencyFormatter.parseKRW('2000000'), 2000000);
      expect(CurrencyFormatter.parseKRW(''), null);
      expect(CurrencyFormatter.parseKRW(null), null);
    });
  });
}