- 모든 서비스 메서드 시그니처를 실제 구현에 맞게 수정 - TestDataGenerator 제거하고 직접 객체 생성으로 변경 - 모델 필드명 및 타입 불일치 수정 - 불필요한 Either 패턴 사용 제거 - null safety 관련 이슈 해결 수정된 파일: - test/integration/screens/company_integration_test.dart - test/integration/screens/equipment_integration_test.dart - test/integration/screens/user_integration_test.dart - test/integration/screens/login_integration_test.dart
93 lines
2.2 KiB
Dart
93 lines
2.2 KiB
Dart
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
|
|
|
/// 테스트를 위한 Mock SecureStorage
|
|
class MockSecureStorage extends FlutterSecureStorage {
|
|
final Map<String, String> _storage = {};
|
|
|
|
@override
|
|
Future<void> write({
|
|
required String key,
|
|
required String? value,
|
|
IOSOptions? iOptions,
|
|
AndroidOptions? aOptions,
|
|
LinuxOptions? lOptions,
|
|
WebOptions? webOptions,
|
|
MacOsOptions? mOptions,
|
|
WindowsOptions? wOptions,
|
|
}) async {
|
|
if (value != null) {
|
|
_storage[key] = value;
|
|
// 디버깅용 print문 제거
|
|
}
|
|
}
|
|
|
|
@override
|
|
Future<String?> read({
|
|
required String key,
|
|
IOSOptions? iOptions,
|
|
AndroidOptions? aOptions,
|
|
LinuxOptions? lOptions,
|
|
WebOptions? webOptions,
|
|
MacOsOptions? mOptions,
|
|
WindowsOptions? wOptions,
|
|
}) async {
|
|
final value = _storage[key];
|
|
// 디버깅용 print문 제거
|
|
return value;
|
|
}
|
|
|
|
@override
|
|
Future<void> delete({
|
|
required String key,
|
|
IOSOptions? iOptions,
|
|
AndroidOptions? aOptions,
|
|
LinuxOptions? lOptions,
|
|
WebOptions? webOptions,
|
|
MacOsOptions? mOptions,
|
|
WindowsOptions? wOptions,
|
|
}) async {
|
|
_storage.remove(key);
|
|
// 디버깅용 print문 제거
|
|
}
|
|
|
|
@override
|
|
Future<void> deleteAll({
|
|
IOSOptions? iOptions,
|
|
AndroidOptions? aOptions,
|
|
LinuxOptions? lOptions,
|
|
WebOptions? webOptions,
|
|
MacOsOptions? mOptions,
|
|
WindowsOptions? wOptions,
|
|
}) async {
|
|
_storage.clear();
|
|
// 디버깅용 print문 제거
|
|
}
|
|
|
|
@override
|
|
Future<Map<String, String>> readAll({
|
|
IOSOptions? iOptions,
|
|
AndroidOptions? aOptions,
|
|
LinuxOptions? lOptions,
|
|
WebOptions? webOptions,
|
|
MacOsOptions? mOptions,
|
|
WindowsOptions? wOptions,
|
|
}) async {
|
|
// 디버깅용 print문 제거
|
|
return Map<String, String>.from(_storage);
|
|
}
|
|
|
|
@override
|
|
Future<bool> containsKey({
|
|
required String key,
|
|
IOSOptions? iOptions,
|
|
AndroidOptions? aOptions,
|
|
LinuxOptions? lOptions,
|
|
WebOptions? webOptions,
|
|
MacOsOptions? mOptions,
|
|
WindowsOptions? wOptions,
|
|
}) async {
|
|
final contains = _storage.containsKey(key);
|
|
// 디버깅용 print문 제거
|
|
return contains;
|
|
}
|
|
} |