Files
EasyDesignCollection/test/license_test.dart
T

21 lines
818 B
Dart
Raw Normal View History

import 'package:flutter_test/flutter_test.dart';
import 'package:sequence_diagram/license/license_service.dart';
void main() {
group('license', () {
test('encodeMac matches the specified algorithm', () {
// AABBCCDDEEFF -> 010102020303040405050606 -> +26 -> reverse
const String expected = '62606050504040303020201010';
expect(LicenseService.encodeMac('AA-BB-CC-DD-EE-FF'), expected);
expect(LicenseService.encodeMac('aabbccddeeff'), expected);
expect(LicenseService.encodeMac('AA BB CC DD EE FF'), expected);
expect(LicenseService.encodeMac('AABBCCDDEEFF'), expected);
});
test('encodeMac handles digits', () {
// '0'..'9' -> 00..09 ; e.g. "12" -> "0102" -> +"26" -> "010226" -> reverse
expect(LicenseService.encodeMac('12'), '622010');
});
});
}