Files
apidash/packages/curl_parser/test/curl_model_test.dart
2024-11-30 22:30:06 +05:30

35 lines
864 B
Dart

import 'package:curl_parser/curl_parser.dart';
import 'package:seed/seed.dart';
import 'package:test/test.dart';
void main() {
test('should not throw when form data entries are provided', () {
expect(
() => Curl(
uri: Uri.parse('https://api.apidash.dev/upload'),
method: 'POST',
form: true,
formData: [
FormDataModel(
name: "username", value: "john", type: FormDataType.text),
FormDataModel(
name: "password", value: "password", type: FormDataType.text),
],
),
returnsNormally,
);
});
test('should not throw when form data is null', () {
expect(
() => Curl(
uri: Uri.parse('https://api.apidash.dev/upload'),
method: 'POST',
form: false,
formData: null,
),
returnsNormally,
);
});
}