@@ -293,7 +293,7 @@ void main() {
293293      ]);
294294    });
295295
296-     test ('does not accept a  invalid imageQuality argument' , () {
296+     test ('does not accept an  invalid imageQuality argument' , () {
297297      expect (
298298        () =>  picker.pickImage (imageQuality:  - 1 , source:  ImageSource .gallery),
299299        throwsArgumentError,
@@ -487,7 +487,7 @@ void main() {
487487      expect (() =>  picker.pickMultiImage (maxHeight:  - 1.0 ), throwsArgumentError);
488488    });
489489
490-     test ('does not accept a  invalid imageQuality argument' , () {
490+     test ('does not accept an  invalid imageQuality argument' , () {
491491      expect (
492492        () =>  picker.pickMultiImage (imageQuality:  - 1 ),
493493        throwsArgumentError,
@@ -760,7 +760,7 @@ void main() {
760760      ]);
761761    });
762762
763-     test ('does not accept a  invalid imageQuality argument' , () {
763+     test ('does not accept an  invalid imageQuality argument' , () {
764764      expect (
765765        () =>  picker.getImage (imageQuality:  - 1 , source:  ImageSource .gallery),
766766        throwsArgumentError,
@@ -955,7 +955,7 @@ void main() {
955955      expect (() =>  picker.getMultiImage (maxHeight:  - 1.0 ), throwsArgumentError);
956956    });
957957
958-     test ('does not accept a  invalid imageQuality argument' , () {
958+     test ('does not accept an  invalid imageQuality argument' , () {
959959      log.returnValue =  < String > ['0' , '1' ];
960960      expect (() =>  picker.getMultiImage (imageQuality:  - 1 ), throwsArgumentError);
961961
@@ -1214,7 +1214,7 @@ void main() {
12141214      );
12151215    });
12161216
1217-     test ('does not accept a  invalid imageQuality argument' , () {
1217+     test ('does not accept an  invalid imageQuality argument' , () {
12181218      log.returnValue =  < String > ['0' , '1' ];
12191219      expect (
12201220        () =>  picker.getMedia (
@@ -1237,20 +1237,37 @@ void main() {
12371237      );
12381238    });
12391239
1240-     test ('does not accept a  invalid limit argument' , () {
1240+     test ('does not accept an  invalid limit argument' , () {
12411241      log.returnValue =  < String > ['0' , '1' ];
1242+       final  Matcher  throwsLimitArgumentError =  throwsA (
1243+         isA <ArgumentError >()
1244+             .having ((ArgumentError  error) =>  error.name, 'name' , 'limit' )
1245+             .having (
1246+               (ArgumentError  error) =>  error.message,
1247+               'message' ,
1248+               'cannot be lower than 2' ,
1249+             ),
1250+       );
1251+ 
12421252      expect (
12431253        () =>  picker.getMedia (
12441254          options:  const  MediaOptions (allowMultiple:  true , limit:  - 1 ),
12451255        ),
1246-         throwsArgumentError ,
1256+         throwsLimitArgumentError ,
12471257      );
12481258
12491259      expect (
12501260        () =>  picker.getMedia (
12511261          options:  const  MediaOptions (allowMultiple:  true , limit:  0 ),
12521262        ),
1253-         throwsArgumentError,
1263+         throwsLimitArgumentError,
1264+       );
1265+ 
1266+       expect (
1267+         () =>  picker.getMedia (
1268+           options:  const  MediaOptions (allowMultiple:  true , limit:  1 ),
1269+         ),
1270+         throwsLimitArgumentError,
12541271      );
12551272    });
12561273
@@ -1563,7 +1580,7 @@ void main() {
15631580      ]);
15641581    });
15651582
1566-     test ('does not accept a  invalid imageQuality argument' , () {
1583+     test ('does not accept an  invalid imageQuality argument' , () {
15671584      expect (
15681585        () =>  picker.getImageFromSource (
15691586          source:  ImageSource .gallery,
@@ -1881,7 +1898,7 @@ void main() {
18811898      );
18821899    });
18831900
1884-     test ('does not accept a  invalid imageQuality argument' , () {
1901+     test ('does not accept an  invalid imageQuality argument' , () {
18851902      log.returnValue =  < String > ['0' , '1' ];
18861903      expect (
18871904        () =>  picker.getMultiImageWithOptions (
@@ -1902,20 +1919,37 @@ void main() {
19021919      );
19031920    });
19041921
1905-     test ('does not accept a  invalid limit argument' , () {
1922+     test ('does not accept an  invalid limit argument' , () {
19061923      log.returnValue =  < String > ['0' , '1' ];
1924+       final  Matcher  throwsLimitArgumentError =  throwsA (
1925+         isA <ArgumentError >()
1926+             .having ((ArgumentError  error) =>  error.name, 'name' , 'limit' )
1927+             .having (
1928+               (ArgumentError  error) =>  error.message,
1929+               'message' ,
1930+               'cannot be lower than 2' ,
1931+             ),
1932+       );
1933+ 
19071934      expect (
19081935        () =>  picker.getMultiImageWithOptions (
19091936          options:  const  MultiImagePickerOptions (limit:  - 1 ),
19101937        ),
1911-         throwsArgumentError ,
1938+         throwsLimitArgumentError ,
19121939      );
19131940
19141941      expect (
19151942        () =>  picker.getMultiImageWithOptions (
19161943          options:  const  MultiImagePickerOptions (limit:  0 ),
19171944        ),
1918-         throwsArgumentError,
1945+         throwsLimitArgumentError,
1946+       );
1947+ 
1948+       expect (
1949+         () =>  picker.getMultiImageWithOptions (
1950+           options:  const  MultiImagePickerOptions (limit:  1 ),
1951+         ),
1952+         throwsLimitArgumentError,
19191953      );
19201954    });
19211955
0 commit comments