Skip to content

Commit 247d1ba

Browse files
committed
updated tests
1 parent bb14507 commit 247d1ba

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

packages/path_provider/path_provider_android/test/path_provider_android_test.dart

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,27 @@ class _Api implements TestPathProviderApi {
3737
String? getTemporaryPath() => kTemporaryPath;
3838
}
3939

40+
class _ApiNull implements TestPathProviderApi {
41+
@override
42+
String? getApplicationDocumentsPath() => null;
43+
44+
@override
45+
String? getApplicationSupportPath() => null;
46+
47+
@override
48+
List<String?> getExternalCachePaths() => <String>[];
49+
50+
@override
51+
String? getExternalStoragePath() => null;
52+
53+
@override
54+
List<String?> getExternalStoragePaths(messages.StorageDirectory directory) =>
55+
<String>[];
56+
57+
@override
58+
String? getTemporaryPath() => null;
59+
}
60+
4061
void main() {
4162
TestWidgetsFlutterBinding.ensureInitialized();
4263

@@ -94,8 +115,8 @@ void main() {
94115
expect(path, kExternalStoragePaths);
95116
});
96117

97-
//TODO: override externalStoragePaths as empty
98118
test('getDownloadsPath null', () async {
119+
TestPathProviderApi.setup(_ApiNull());
99120
final String? path = await pathProvider.getDownloadsPath();
100121
expect(path, null);
101122
});

0 commit comments

Comments
 (0)