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_boost/flutter_boost.dart';
......@@ -11,11 +12,17 @@ void main() {
//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 {
FlutterBoost.singleton.open("url");
} catch (e) {
......@@ -27,16 +34,15 @@ void main() {
expect(e, isNoSuchMethodError);
}
try {
FlutterBoost.singleton.close("closeCurrent");
FlutterBoost.singleton.closeCurrent(result: {}, exts: {});
} catch (e) {
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