mirror of
https://github.com/appwrite/sdk-for-dart.git
synced 2026-06-06 19:27:59 +00:00
30 lines
788 B
Dart
30 lines
788 B
Dart
import 'package:dart_appwrite/src/exception.dart';
|
|
import 'package:test/test.dart';
|
|
|
|
void main() {
|
|
group('AppwriteException', () {
|
|
test('toString should return correct string representation', () {
|
|
final exception1 = AppwriteException();
|
|
expect(exception1.toString(), equals('AppwriteException'));
|
|
|
|
final exception2 = AppwriteException('Some error message');
|
|
expect(
|
|
exception2.toString(),
|
|
equals('AppwriteException: , Some error message (0)'),
|
|
);
|
|
|
|
final exception3 = AppwriteException(
|
|
'Invalid request',
|
|
400,
|
|
'ValidationError',
|
|
);
|
|
expect(
|
|
exception3.toString(),
|
|
equals(
|
|
'AppwriteException: ValidationError, Invalid request (400)',
|
|
),
|
|
);
|
|
});
|
|
});
|
|
}
|