File tree 2 files changed +37
-2
lines changed
packages/agent_dart_base/test/agent
2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change
1
+ import 'package:agent_dart_base/agent_dart_base.dart' ;
2
+ import 'package:test/test.dart' ;
3
+
1
4
void main () {
2
5
actorTest ();
3
6
}
4
7
5
8
void actorTest () {
6
- /// skip, see https://github.com/dfinity/agent-js/blob/main/packages/agent/src/actor.test.ts
9
+ test ('actor' , () async {
10
+ final agent = HttpAgent (
11
+ defaultHost: 'icp-api.io' ,
12
+ defaultPort: 443 ,
13
+ options: const HttpAgentOptions (identity: AnonymousIdentity ()),
14
+ );
15
+ final idl = IDL .Service ({
16
+ 'create_challenge' : IDL .Func (
17
+ [],
18
+ [
19
+ IDL .Record ({
20
+ 'png_base64' : IDL .Text ,
21
+ 'challenge_key' : IDL .Text ,
22
+ }),
23
+ ],
24
+ [],
25
+ ),
26
+ });
27
+ final actor = CanisterActor (
28
+ ActorConfig (
29
+ canisterId: Principal .fromText ('rdmx6-jaaaa-aaaaa-aaadq-cai' ),
30
+ agent: agent,
31
+ ),
32
+ idl,
33
+ );
34
+ final result = await actor.getFunc ('create_challenge' )! .call ([]);
35
+ expect (result, isA <Map >());
36
+ expect (result['challenge_key' ], isA <String >());
37
+ });
7
38
}
Original file line number Diff line number Diff line change
1
+ import '../test_utils.dart' ;
2
+ import 'actor.dart' as actor;
1
3
import 'cbor.dart' as cbor;
2
4
import 'certificate.dart' as certificate;
3
5
import 'request_id.dart' as request_id;
@@ -6,10 +8,12 @@ import 'utils/hash.dart' as hash;
6
8
import 'utils/leb128.dart' as leb128;
7
9
8
10
void main () {
11
+ ffiInit ();
12
+ actor.main ();
13
+ cbor.main ();
9
14
certificate.main ();
10
15
request_id.main ();
11
16
bls.main ();
12
17
hash.main ();
13
18
leb128.main ();
14
- cbor.main ();
15
19
}
You can’t perform that action at this time.
0 commit comments