Commit 47c27577 authored by yangwu.jia's avatar yangwu.jia

Add test

parent 9e07e9f2
...@@ -14,12 +14,12 @@ import 'unit/flutter_boost_test.dart' as flutter_boost; ...@@ -14,12 +14,12 @@ import 'unit/flutter_boost_test.dart' as flutter_boost;
void main() { void main() {
TestWidgetsFlutterBinding.ensureInitialized(); TestWidgetsFlutterBinding.ensureInitialized();
group('all_test', () { // group('all_test', () {
boost_channel.main(); // boost_channel.main();
// boost_container.main(); //// boost_container.main();
boost_page_route.main(); // boost_page_route.main();
container_coordinator.main(); // container_coordinator.main();
container_manager.main(); // container_manager.main();
flutter_boost.main(); // flutter_boost.main();
}); // });
} }
...@@ -109,8 +109,6 @@ void main() { ...@@ -109,8 +109,6 @@ void main() {
(WidgetTester tester) async { (WidgetTester tester) async {
await tester.pumpWidget(MyApp()); await tester.pumpWidget(MyApp());
// Navigator.pushNamed(scaffoldKey.currentContext, "first");
expect(find.text('First'), findsNothing); expect(find.text('First'), findsNothing);
}); });
} }
import 'package:flutter/widgets.dart';
import 'package:flutter_boost/flutter_boost.dart'; import 'package:flutter_boost/flutter_boost.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
void main() { void main() {
const MethodChannel channel = MethodChannel('flutter_boost');
final List<MethodCall> log = <MethodCall>[];
dynamic response;
group('boost_container', () { channel.setMockMethodCallHandler((MethodCall methodCall) async {
print(methodCall);
log.add(methodCall);
return response;
});
tearDown(() {
log.clear();
});
TestWidgetsFlutterBinding.ensureInitialized();
group('flutter_boost', () {
response = null;
test('init successfully', () async {
Function builder = FlutterBoost.init();
expect(
builder.runtimeType,
TransitionBuilder,
);
}); });
test('open successfully', () async {
Future<Map<dynamic, dynamic>> result = FlutterBoost.singleton.open("url");
expect(
result,
isInstanceOf<Future<Map<dynamic, dynamic>>>(),
);
});
// test('close successfully', () async {
// Future<bool> result = FlutterBoost.singleton.close("id");
//
// expect(
// result,
// isInstanceOf<bool>(),
// );
// });
});
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment