vlogs_sdk_dart/test/vlogs_test.dart

30 lines
800 B
Dart
Raw Normal View History

2023-05-27 01:06:18 +07:00
// ignore_for_file: non_constant_identifier_names
import 'package:test/test.dart';
import 'package:vlogs/vlogs.dart';
void main() {
final APP_ID = "72bd14c306a91fa8a590330e3898ddcc";
final API_KEY = "vlogs_gX9WwSdKatMNdpUClLU0IfCx575tvdoeQ";
group('Run collecting the logs', () {
2023-05-27 09:47:24 +07:00
final sdk = VLogs.create(
VLogsOptions.builder().appId(APP_ID).apiKey(API_KEY).build());
2023-05-27 01:06:18 +07:00
setUp(() {
expect(sdk, isNotNull);
2023-05-27 01:06:18 +07:00
});
test('Emit the logs to collector', () async {
var request = Collector.builder()
2023-05-27 09:47:24 +07:00
.message("Hello from Dart SDK 1.0.0")
2023-05-27 01:06:18 +07:00
.source(CollectorSource.mobile.name)
.type(CollectorType.log.name)
.build();
var response = await sdk.collect(request);
expect(response.id, request.getId());
});
});
}