Commit eada40d8 authored by yangwu.jia's avatar yangwu.jia

Add test case

parent 4304a694
import 'package:flutter_boost/container/container_manager.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_boost/flutter_boost.dart'; import 'package:flutter_boost/flutter_boost.dart';
...@@ -11,11 +12,17 @@ void main() { ...@@ -11,11 +12,17 @@ void main() {
//push app //push app
}); });
test('test onMethodCall', () async {
FlutterBoost.singleton
.registerDefaultPageBuilder((pageName, params, _) => Container());
FlutterBoost.singleton.addContainerObserver(
(ContainerOperation operation, BoostContainerSettings settings) {});
FlutterBoost.singleton.addBoostContainerLifeCycleObserver(
(ContainerLifeCycle state, BoostContainerSettings settings) {});
test('test onMethodCall', () async { FlutterBoost.singleton.addBoostNavigatorObserver(NavigatorObserver());
FlutterBoost.singleton.registerDefaultPageBuilder((pageName, params, _) => Container());
try { try {
FlutterBoost.singleton.open("url"); FlutterBoost.singleton.open("url");
} catch (e) { } catch (e) {
...@@ -27,16 +34,15 @@ void main() { ...@@ -27,16 +34,15 @@ void main() {
expect(e, isNoSuchMethodError); expect(e, isNoSuchMethodError);
} }
try { try {
FlutterBoost.singleton.close("closeCurrent"); FlutterBoost.singleton.closeCurrent(result: {}, exts: {});
} catch (e) { } catch (e) {
expect(e, isNoSuchMethodError); expect(e, isNoSuchMethodError);
} }
try {
FlutterBoost.singleton.closeByContext(null, result: {}, exts: {});
} catch (e) {
expect(e, isNoSuchMethodError);
}
}); });
} }
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