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.
38 lines
1.2 KiB
38 lines
1.2 KiB
import 'package:nextcloud/nextcloud.dart'; |
|
import 'package:test/test.dart'; |
|
|
|
import 'helper.dart'; |
|
|
|
Future main() async { |
|
final dockerImageName = await TestHelper.prepareDockerImage(); |
|
|
|
group('provisioning_api', () { |
|
late TestNextcloudClient client; |
|
setUp(() async { |
|
client = await TestHelper.getPreparedClient(dockerImageName); |
|
}); |
|
tearDown(() => client.destroy()); |
|
|
|
test('Get current user', () async { |
|
final user = (await validateResponse<ProvisioningApiUser, void>( |
|
client.provisioningApi, |
|
client.provisioningApi.getCurrentUserWithHttpInfo(), |
|
))!; |
|
expect(user.ocs!.data!.id, 'test'); |
|
expect(user.ocs!.data!.getDisplayName(), 'Test'); |
|
expect(user.ocs!.data!.displaynameScope, 'v2-federated'); |
|
expect(user.ocs!.data!.language, 'en'); |
|
}); |
|
|
|
test('Get user by username', () async { |
|
final user = (await validateResponse<ProvisioningApiUser, void>( |
|
client.provisioningApi, |
|
client.provisioningApi.getUserWithHttpInfo('test'), |
|
))!; |
|
expect(user.ocs!.data!.id, 'test'); |
|
expect(user.ocs!.data!.getDisplayName(), 'Test'); |
|
expect(user.ocs!.data!.displaynameScope, 'v2-federated'); |
|
expect(user.ocs!.data!.language, 'en'); |
|
}); |
|
}); |
|
}
|
|
|