chain-client-sdk-dart/test/chain_client_sdk_test.dart
flemming-it 14c8f38f36
Some checks failed
Security / Security check (push) Failing after 2s
refactor: rename package fai_client_sdk -> chain_client_sdk
The SDK belongs to the Ch∆In product, not the F∆I vendor namespace
(a future Brain client SDK would otherwise collide). Rename the Dart
package, entry library, test + example files. Also drop a private
project name from a doc comment. dart analyze: clean.

Dependents must update their dependency name + package: imports.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-06-16 17:39:12 +02:00

31 lines
848 B
Dart

import 'package:chain_client_sdk/chain_client_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 shuts the channel cleanly', () async {
final c = HubClient();
await c.close();
});
});
}