This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_bloc_weather/features/search/data/model/city_model.dart'; | |
import 'package:flutter_bloc_weather/features/search/data/services/search_api_services.dart'; | |
import 'package:flutter_bloc_weather/features/search/ui/city_search_page.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:get_it/get_it.dart'; | |
import 'package:integration_test/integration_test.dart'; | |
class FakeSearchService implements SearchApiServices { | |
@override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:integration_test/integration_test_driver.dart'; | |
Future<void> main() => integrationDriver(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:mockito/mockito.dart'; | |
import 'package:get_it/get_it.dart'; | |
import 'package:flutter_bloc_weather/features/search/ui/city_search_page.dart'; | |
import 'package:flutter_bloc_weather/features/search/data/services/search_api_services.dart'; | |
import 'package:flutter_bloc_weather/features/search/data/model/city_model.dart'; | |
import '../bloc/api_mock.mocks.dart'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter_bloc_weather/features/search/bloc/city_search_cubit.dart'; | |
import 'package:flutter_bloc_weather/features/search/bloc/city_search_state.dart'; | |
import 'package:flutter_bloc_weather/features/search/data/model/city_model.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:bloc_test/bloc_test.dart'; | |
import 'package:get_it/get_it.dart'; | |
import 'package:mockito/mockito.dart'; | |
import 'package:flutter_bloc_weather/features/search/data/services/search_api_services.dart'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:mockito/annotations.dart'; | |
import 'package:flutter_bloc_weather/features/search/data/services/search_api_services.dart'; | |
@GenerateMocks([SearchApiServices]) | |
void main() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:mockito/mockito.dart'; | |
import 'package:dio/dio.dart'; | |
import 'package:flutter_bloc_weather/features/search/data/services/search_api_services.dart'; | |
import 'mock.mocks.dart'; // Make sure this is generated from mock.dart | |
void main() { | |
group('SearchApiServices', () { | |
late MockDio mockDio; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:dio/dio.dart'; | |
import 'package:mockito/annotations.dart'; | |
@GenerateMocks([Dio]) | |
void main() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:json_annotation/json_annotation.dart'; | |
part 'city_model.g.dart'; | |
@JsonSerializable() | |
class CityModel { | |
final List<CitySearchModel> results; | |
CityModel({required this.results}); | |
factory CityModel.fromJson(Map<String, dynamic> json) => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:integration_test/integration_test.dart'; | |
import 'package:untitled/main.dart'; // Adjust if your main.dart is in another folder | |
void main() { | |
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | |
testWidgets("Full app integration test", (WidgetTester tester) async { | |
await tester.pumpWidget(const MyApp()); |
NewerOlder