@@ -21,38 +21,26 @@ void main() async {
21
21
print (batteryLevel);
22
22
});
23
23
24
- group ('Complex plugin' , () {
24
+ // A more complicated plugin
25
+ //
26
+ test ('Test StandardMethodCodec array of map' , () async {
25
27
const platform_complex_structure =
26
28
const MethodChannel ('instance.id/go/data' );
27
29
28
- // A more complicated plugin
29
- test ('Test StandardMethodCodec array of map' , () async {
30
- final List <dynamic > result =
31
- await platform_complex_structure.invokeMethod ('getData' ,
32
- "HelloFromDart" ); // passing "HelloFromDart" as an argument
33
- expect (result, [
34
- {"instanceid" : 1023 , "pcbackup" : "test" , "brbackup" : "test2" },
35
- {"instanceid" : 1024 , "pcbackup" : "test" , "brbackup" : "test2" },
36
- {"instanceid" : 1056 , "pcbackup" : "coucou" , "brbackup" : "coucou2" },
37
- {"instanceid" : 3322 , "pcbackup" : "finaly" , "brbackup" : "finaly2" }
38
- ]);
39
-
40
- // golang can return the random methodName
41
- final String methodName =
42
- 'test/' + new Random ().nextInt (100000 ).toString ();
43
- final String resultPathPrefix =
44
- await platform_complex_structure.invokeMethod (methodName);
45
- expect (resultPathPrefix, methodName);
46
- });
47
-
48
- test ('Custom errors' , () async {
49
- var matcher = predicate (
50
- (e) => e is PlatformException && e.code == "customErrorCode" );
51
- expect (
52
- platform_complex_structure.invokeMethod ('getError' ),
53
- throwsA (matcher),
54
- );
55
- });
30
+ final List <dynamic > result = await platform_complex_structure.invokeMethod (
31
+ 'getData' , "HelloFromDart" ); // passing "HelloFromDart" as an argument
32
+ expect (result, [
33
+ {"instanceid" : 1023 , "pcbackup" : "test" , "brbackup" : "test2" },
34
+ {"instanceid" : 1024 , "pcbackup" : "test" , "brbackup" : "test2" },
35
+ {"instanceid" : 1056 , "pcbackup" : "coucou" , "brbackup" : "coucou2" },
36
+ {"instanceid" : 3322 , "pcbackup" : "finaly" , "brbackup" : "finaly2" }
37
+ ]);
38
+
39
+ // golang can return the random methodName
40
+ final String methodName = 'test/' + new Random ().nextInt (100000 ).toString ();
41
+ final String resultPathPrefix =
42
+ await platform_complex_structure.invokeMethod (methodName);
43
+ expect (resultPathPrefix, methodName);
56
44
});
57
45
58
46
tearDownAll (() async {
0 commit comments