Files
smooth-app/packages/smooth_app/test/tests_utils/path_provider_mock.dart
Edouard Marquez 8b658338df feat: Nutritional values: ensure only one decimal separator is displayed (#2143)
* Nutritional values: ensure only one decimal separator is displayed

* Add an assert

* Some tests for StringExtensions

* More tests

* Better support multiple separators
2022-06-06 12:31:15 +02:00

52 lines
1.2 KiB
Dart

import 'dart:io';
import 'package:mockito/mockito.dart';
import 'package:path_provider_platform_interface/path_provider_platform_interface.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
class MockedPathProviderPlatform extends Mock
with MockPlatformInterfaceMixin
implements PathProviderPlatform {
@override
Future<String?> getTemporaryPath() async {
return Directory.systemTemp.path;
}
@override
Future<String?> getApplicationSupportPath() async {
return Directory.systemTemp.path;
}
@override
Future<String?> getLibraryPath() async {
return Directory.systemTemp.path;
}
@override
Future<String?> getApplicationDocumentsPath() async {
return Directory.systemTemp.path;
}
@override
Future<String?> getExternalStoragePath() async {
return Directory.systemTemp.path;
}
@override
Future<List<String>?> getExternalCachePaths() async {
return <String>[Directory.systemTemp.path];
}
@override
Future<List<String>?> getExternalStoragePaths({
StorageDirectory? type,
}) async {
return <String>[Directory.systemTemp.path];
}
@override
Future<String?> getDownloadsPath() async {
return Directory.systemTemp.path;
}
}