parent
4e0cf44414
commit
d0a80076a6
@ -1,8 +1,56 @@
|
||||
# Generated by pub on 2018-09-29 10:15:14.625856.
|
||||
# Generated by pub on 2018-10-08 23:40:55.475551.
|
||||
analyzer:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.33.0/lib/
|
||||
args:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.5.0/lib/
|
||||
async:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.0.8/lib/
|
||||
boolean_selector:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-1.0.4/lib/
|
||||
charcode:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/
|
||||
collection:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.14.11/lib/
|
||||
convert:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/convert-2.0.2/lib/
|
||||
crypto:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-2.0.6/lib/
|
||||
csslib:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/csslib-0.14.6/lib/
|
||||
flutter:file:///Applications/flutter/packages/flutter/lib/
|
||||
front_end:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/front_end-0.1.6/lib/
|
||||
glob:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/glob-1.1.7/lib/
|
||||
html:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/html-0.13.3+3/lib/
|
||||
http:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.0/lib/
|
||||
http_multi_server:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.0.5/lib/
|
||||
http_parser:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.3/lib/
|
||||
io:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/io-0.3.3/lib/
|
||||
js:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.1+1/lib/
|
||||
json_rpc_2:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/json_rpc_2-2.0.9/lib/
|
||||
kernel:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/kernel-0.3.6/lib/
|
||||
logging:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/logging-0.11.3+2/lib/
|
||||
matcher:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.3+1/lib/
|
||||
meta:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.1.6/lib/
|
||||
mime:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/mime-0.9.6+2/lib/
|
||||
mockito:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/mockito-3.0.0/lib/
|
||||
multi_server_socket:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/multi_server_socket-1.0.2/lib/
|
||||
node_preamble:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/node_preamble-1.4.4/lib/
|
||||
package_config:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/package_config-1.0.5/lib/
|
||||
package_resolver:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/package_resolver-1.0.6/lib/
|
||||
path:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.6.2/lib/
|
||||
platform:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/platform-2.2.0/lib/
|
||||
plugin:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/plugin-0.2.0+3/lib/
|
||||
pool:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/pool-1.3.6/lib/
|
||||
pub_semver:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/pub_semver-1.4.2/lib/
|
||||
shelf:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-0.7.3+3/lib/
|
||||
shelf_packages_handler:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_packages_handler-1.0.4/lib/
|
||||
shelf_static:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_static-0.2.8/lib/
|
||||
shelf_web_socket:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_web_socket-0.2.2+4/lib/
|
||||
sky_engine:file:///Applications/flutter/bin/cache/pkg/sky_engine/lib/
|
||||
source_map_stack_trace:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/source_map_stack_trace-1.1.5/lib/
|
||||
source_maps:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/source_maps-0.10.8/lib/
|
||||
source_span:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.4.1/lib/
|
||||
stack_trace:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.9.3/lib/
|
||||
stream_channel:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-1.6.8/lib/
|
||||
string_scanner:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.0.4/lib/
|
||||
term_glyph:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.0.1/lib/
|
||||
test:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/test-1.3.4/lib/
|
||||
typed_data:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.1.6/lib/
|
||||
utf:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/utf-0.9.0+5/lib/
|
||||
vector_math:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/
|
||||
vm_service_client:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/vm_service_client-0.2.6/lib/
|
||||
watcher:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/watcher-0.9.7+10/lib/
|
||||
web_socket_channel:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/web_socket_channel-1.0.9/lib/
|
||||
yaml:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/yaml-2.1.15/lib/
|
||||
jpush_flutter:lib/
|
||||
|
@ -0,0 +1,88 @@
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:platform/platform.dart';
|
||||
import 'package:test/test.dart';
|
||||
import 'package:jpush_flutter/jpush_flutter.dart';
|
||||
|
||||
|
||||
void main() {
|
||||
MockMethodChannel mockChannel;
|
||||
JPush jpush;
|
||||
|
||||
setUp(() {
|
||||
mockChannel = new MockMethodChannel();
|
||||
jpush = new JPush.private(mockChannel, FakePlatform(operatingSystem: 'ios'));
|
||||
});
|
||||
|
||||
jpush.setup(
|
||||
appKey: "a1703c14b186a68a66ef86c1",
|
||||
channel: "theChannel",
|
||||
production: false
|
||||
);
|
||||
|
||||
test('applyPushAuthority on ios with params', () {
|
||||
jpush = new JPush.private(mockChannel, FakePlatform(operatingSystem: 'ios'));
|
||||
jpush.applyPushAuthority(new NotificationSettingsIOS(
|
||||
sound: true,
|
||||
alert: true,
|
||||
badge: true));
|
||||
verify(mockChannel.invokeMethod('applyPushAuthority',
|
||||
<String, bool>{'sound': true, 'badge': true, 'alert': true}));
|
||||
});
|
||||
|
||||
test('addEventHandler', () {
|
||||
// TODO:
|
||||
});
|
||||
|
||||
test('setAlias', () {
|
||||
jpush = new JPush.private(mockChannel, FakePlatform(operatingSystem: 'ios'));
|
||||
jpush.setAlias('alias').then((map) {
|
||||
expect(map, contains('alias'));
|
||||
}).catchError((error) {});
|
||||
});
|
||||
|
||||
test('deleteAlias', () {
|
||||
jpush = new JPush.private(mockChannel, FakePlatform(operatingSystem: 'ios'));
|
||||
jpush.deleteAlias().then((map) {
|
||||
expect(map, contains('alias'));
|
||||
}).catchError((error) {});
|
||||
});
|
||||
|
||||
test('deleteAlias', () {
|
||||
jpush = new JPush.private(mockChannel, FakePlatform(operatingSystem: 'ios'));
|
||||
jpush.deleteAlias().then((map) {
|
||||
expect(map, contains('alias'));
|
||||
}).catchError((error) {});
|
||||
});
|
||||
|
||||
test('addTags', () {
|
||||
jpush = new JPush.private(mockChannel, FakePlatform(operatingSystem: 'ios'));
|
||||
jpush.addTags(["tag1","tag2"]).then((map) {
|
||||
expect(map, contains('tags'));
|
||||
}).catchError((error) {});
|
||||
});
|
||||
|
||||
test('deleteTags', () {
|
||||
jpush = new JPush.private(mockChannel, FakePlatform(operatingSystem: 'ios'));
|
||||
jpush.deleteTags(["tag1","tag2"]).then((map) {
|
||||
expect(map, contains('tags'));
|
||||
}).catchError((error) {});
|
||||
});
|
||||
|
||||
test('setTags', () {
|
||||
jpush = new JPush.private(mockChannel, FakePlatform(operatingSystem: 'ios'));
|
||||
jpush.setTags(["tag1","tag2"]).then((map) {
|
||||
expect(map, contains('tags'));
|
||||
}).catchError((error) {});
|
||||
});
|
||||
|
||||
test('getAllTags', () {
|
||||
jpush = new JPush.private(mockChannel, FakePlatform(operatingSystem: 'ios'));
|
||||
jpush.getAllTags().then((map) {
|
||||
expect(map, contains('tags'));
|
||||
}).catchError((error) {});
|
||||
});
|
||||
}
|
||||
|
||||
class MockMethodChannel extends Mock implements MethodChannel {}
|
Loading…
Reference in new issue