This commit is contained in:
Brett
2025-09-15 17:30:30 +08:00
parent 6cf7b54e24
commit 169affa005
25 changed files with 909 additions and 210 deletions

View File

@@ -1,6 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.openim.flutter_openim_sdk">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
package="io.openim.flutter_openim_sdk">
</manifest>

View File

@@ -0,0 +1,33 @@
package io.openim.flutter_openim_sdk;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import org.junit.Test;
/**
* This demonstrates a simple unit test of the Java portion of this plugin's
* implementation.
*
* Once you have built the plugin's example app, you can run these tests from
* the command
* line by running `./gradlew testDebugUnitTest` in the `example/android/`
* directory, or
* you can run them directly from IDEs that support JUnit such as Android
* Studio.
*/
public class FlutterOpenimSdkPluginTest {
@Test
public void onMethodCall_getPlatformVersion_returnsExpectedValue() {
FlutterOpenimSdkPlugin plugin = new FlutterOpenimSdkPlugin();
final MethodCall call = new MethodCall("getPlatformVersion", null);
MethodChannel.Result mockResult = mock(MethodChannel.Result.class);
plugin.onMethodCall(call, mockResult);
verify(mockResult).success("Android " + android.os.Build.VERSION.RELEASE);
}
}