TDD 작성
This commit is contained in:
@@ -10,6 +10,7 @@ import 'package:lanebow/models/club_model.dart';
|
||||
import 'package:lanebow/services/api_service.dart';
|
||||
import 'package:lanebow/services/club_service.dart';
|
||||
import 'package:lanebow/services/event_bus.dart';
|
||||
import 'package:lanebow/utils/test_utils.dart';
|
||||
|
||||
import 'club_service_integration_test.mocks.dart';
|
||||
|
||||
@@ -17,8 +18,14 @@ import 'club_service_integration_test.mocks.dart';
|
||||
void main() {
|
||||
late ClubService clubService;
|
||||
late MockApiService mockApiService;
|
||||
late String testId;
|
||||
|
||||
setUp(() {
|
||||
// 테스트 ID 생성 및 설정
|
||||
testId = 'club_service_integration_test_${DateTime.now().millisecondsSinceEpoch}';
|
||||
EventBus.setCurrentTestId(testId);
|
||||
TestUtils.setTestMode(true);
|
||||
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
SharedPreferences.setMockInitialValues({
|
||||
ApiConfig.clubIdKey: 'test_club_id' // SharedPreferences에 clubId 설정
|
||||
@@ -37,6 +44,16 @@ void main() {
|
||||
});
|
||||
|
||||
clubService = ClubService.forTest(mockApiService);
|
||||
|
||||
print('EventBus: 초기화됨 (테스트 ID: $testId)');
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
// 테스트 종료 후 정리
|
||||
clubService.dispose();
|
||||
EventBus.clearCurrentTestId();
|
||||
TestUtils.setTestMode(false);
|
||||
print('EventBus: 초기화됨 (테스트 ID: $testId)');
|
||||
});
|
||||
|
||||
group('ClubService 통합 테스트', () {
|
||||
|
||||
Reference in New Issue
Block a user