You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.0 KiB
39 lines
1.0 KiB
3 years ago
|
import 'package:nextcloud/nextcloud.dart';
|
||
|
import 'package:test/test.dart';
|
||
|
|
||
|
import 'helper.dart';
|
||
|
|
||
|
Future main() async {
|
||
|
final dockerImageName = await TestHelper.prepareDockerImage();
|
||
|
|
||
|
group('client', () {
|
||
|
late TestNextcloudClient client;
|
||
|
tearDown(() => client.destroy());
|
||
|
|
||
|
test('User-Agent from AppType', () async {
|
||
|
client = await TestHelper.getPreparedClient(
|
||
|
dockerImageName,
|
||
|
appType: AppType.nextcloud,
|
||
|
);
|
||
|
expect(client.userAgent, AppType.nextcloud.userAgent);
|
||
|
});
|
||
|
|
||
|
test('User-Agent with suffix', () async {
|
||
|
client = await TestHelper.getPreparedClient(
|
||
|
dockerImageName,
|
||
|
userAgentSuffix: 'test',
|
||
|
);
|
||
|
expect(client.userAgent, 'test');
|
||
|
});
|
||
|
|
||
|
test('User-Agent from AppType with suffix', () async {
|
||
|
client = await TestHelper.getPreparedClient(
|
||
|
dockerImageName,
|
||
|
appType: AppType.nextcloud,
|
||
|
userAgentSuffix: ' test',
|
||
|
);
|
||
|
expect(client.userAgent, '${AppType.nextcloud.userAgent} test');
|
||
|
});
|
||
|
});
|
||
|
}
|