sensor_test.dart 859 B

123456789101112131415161718192021222324252627
  1. import 'package:flutter_test/flutter_test.dart';
  2. import 'package:sensor/sensor.dart';
  3. import 'package:plugin_platform_interface/plugin_platform_interface.dart';
  4. // class MockSensorPlatform
  5. // with MockPlatformInterfaceMixin
  6. // implements SensorPlatform {
  7. //
  8. // @override
  9. // Future<String?> getPlatformVersion() => Future.value('42');
  10. // }
  11. //
  12. // void main() {
  13. // final SensorPlatform initialPlatform = SensorPlatform.instance;
  14. //
  15. // test('$MethodChannelSensor is the default instance', () {
  16. // expect(initialPlatform, isInstanceOf<MethodChannelSensor>());
  17. // });
  18. //
  19. // test('getPlatformVersion', () async {
  20. // Sensor sensorPlugin = Sensor();
  21. // MockSensorPlatform fakePlatform = MockSensorPlatform();
  22. // SensorPlatform.instance = fakePlatform;
  23. //
  24. // expect(await sensorPlugin.getPlatformVersion(), '42');
  25. // });
  26. // }