mirror of
https://github.com/RxReader/tencent_kit.git
synced 2025-06-27 15:36:15 +08:00
.gitignore.metadataCHANGELOG.mdLICENSEREADME.mdanalysis_options.yaml
android
example
.gitignorepubspec.lockpubspec.yaml
android
integration_test
ios
Flutter
PodfilePodfile.lockRunner.xcodeproj
Runner
Assets.xcassets/AppIcon.appiconset
Icon-App-20x20@1x.pngIcon-App-20x20@2x.pngIcon-App-20x20@3x.pngIcon-App-29x29@1x.pngIcon-App-29x29@2x.pngIcon-App-29x29@3x.pngIcon-App-40x40@1x.pngIcon-App-40x40@2x.pngIcon-App-40x40@3x.pngIcon-App-60x60@2x.pngIcon-App-60x60@3x.pngIcon-App-76x76@1x.pngIcon-App-76x76@2x.pngIcon-App-83.5x83.5@2x.png
Info.plistRunnerTests
ios
lib
pubspec.yamltest
123
test/tencent_kit_test.dart
Normal file
123
test/tencent_kit_test.dart
Normal file
@ -0,0 +1,123 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
|
||||
import 'package:tencent_kit/src/constant.dart';
|
||||
import 'package:tencent_kit/src/model/resp.dart';
|
||||
import 'package:tencent_kit/src/tencent_kit_method_channel.dart';
|
||||
import 'package:tencent_kit/src/tencent_kit_platform_interface.dart';
|
||||
|
||||
class MockTencentKitPlatform
|
||||
with MockPlatformInterfaceMixin
|
||||
implements TencentKitPlatform {
|
||||
@override
|
||||
Future<void> setIsPermissionGranted({
|
||||
required bool granted,
|
||||
String? buildModel,
|
||||
}) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> registerApp({
|
||||
required String appId,
|
||||
String? universalLink,
|
||||
}) async {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> isQQInstalled() {
|
||||
return Future<bool>.value(true);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> isTIMInstalled() {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<TencentResp> respStream() {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> login({
|
||||
required List<String> scope,
|
||||
}) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> logout() {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> shareImage({
|
||||
required int scene,
|
||||
required Uri imageUri,
|
||||
String? appName,
|
||||
int extInt = TencentQZoneFlag.kDefault,
|
||||
}) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> shareMood({
|
||||
required int scene,
|
||||
String? summary,
|
||||
List<Uri>? imageUris,
|
||||
Uri? videoUri,
|
||||
}) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> shareMusic({
|
||||
required int scene,
|
||||
required String title,
|
||||
String? summary,
|
||||
Uri? imageUri,
|
||||
required String musicUrl,
|
||||
required String targetUrl,
|
||||
String? appName,
|
||||
int extInt = TencentQZoneFlag.kDefault,
|
||||
}) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> shareText({
|
||||
required int scene,
|
||||
required String summary,
|
||||
}) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> shareWebpage({
|
||||
required int scene,
|
||||
required String title,
|
||||
String? summary,
|
||||
Uri? imageUri,
|
||||
required String targetUrl,
|
||||
String? appName,
|
||||
int extInt = TencentQZoneFlag.kDefault,
|
||||
}) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
|
||||
void main() {
|
||||
final TencentKitPlatform initialPlatform = TencentKitPlatform.instance;
|
||||
|
||||
test('$MethodChannelTencentKit is the default instance', () {
|
||||
expect(initialPlatform, isInstanceOf<MethodChannelTencentKit>());
|
||||
});
|
||||
|
||||
test('isQQInstalled', () async {
|
||||
final MockTencentKitPlatform fakePlatform = MockTencentKitPlatform();
|
||||
TencentKitPlatform.instance = fakePlatform;
|
||||
|
||||
expect(await TencentKitPlatform.instance.isQQInstalled(), true);
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user