Add API contract Dart models

This commit is contained in:
Codex
2026-07-02 13:00:17 +09:00
parent d890893966
commit 6d05f36dcc
10 changed files with 864 additions and 6 deletions
+15
View File
@@ -0,0 +1,15 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:tdc114plus/src/core/network/api_error.dart';
void main() {
test('ApiError parses common error payload', () {
final error = ApiError.fromJson({
'error': 'Unauthorized',
'code': 'unauthorized',
'details': {'reason': 'expired'},
});
expect(error.code, 'unauthorized');
expect(error.details['reason'], 'expired');
});
}