chain-client-sdk-dart/test/fai_dart_sdk_test.dart
flemming-it d405a6a9bd feat: fai_dart_sdk scaffold
Dart package skeleton for the F∆I gRPC client. Used by F∆I
Studio (Tier-2) and Tier-3 domain apps (DigiScout / J∆I /
Scout). Public surface — HubClient, HubEndpoint — is committed
as a typed stub so downstream apps can compile against it
immediately. Generated proto bindings land in a follow-up
commit once the codegen step (planned: tools/generate.sh
wrapping protoc-gen-dart against ../fai_platform/proto) is
wired in.

Future Forgejo path: fai/dart-sdk.

dart analyze: clean. dart test: 4/4.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-05-05 14:19:39 +02:00

31 lines
837 B
Dart

import 'package:fai_dart_sdk/fai_dart_sdk.dart';
import 'package:test/test.dart';
void main() {
group('HubEndpoint', () {
test('default endpoint targets local fai serve', () {
const e = HubEndpoint();
expect(e.host, '127.0.0.1');
expect(e.port, 50051);
expect(e.secure, false);
expect(e.toString(), 'http://127.0.0.1:50051');
});
test('secure flag flips scheme', () {
const e = HubEndpoint(host: 'hub.example', port: 443, secure: true);
expect(e.toString(), 'https://hub.example:443');
});
});
group('HubClient', () {
test('constructs with default endpoint', () {
final c = HubClient();
expect(c.endpoint.host, '127.0.0.1');
});
test('close is a no-op on the stub', () async {
final c = HubClient();
await c.close();
});
});
}