diff --git a/test/mock/audio_provider_mock.dart b/test/mock/audio_provider_mock.dart new file mode 100644 index 0000000..0a723b4 --- /dev/null +++ b/test/mock/audio_provider_mock.dart @@ -0,0 +1,22 @@ +import 'package:audioplayers/audioplayers.dart'; +import 'package:smoke_cess_app/providers/audio_provider.dart'; + +class AudioProviderMock extends AudioProvider { + @override + bool get isMuted => true; + + @override + void stop() {} + + @override + void playFinishSound() {} + + @override + void mutePlayer() {} + + @override + void unMutePlayer() {} + + @override + void playSourceAfterBeep(AssetSource source) {} +} diff --git a/test/unit_tests/workout_provider_test.dart b/test/unit_tests/workout_provider_test.dart index 45c7685..f708703 100644 --- a/test/unit_tests/workout_provider_test.dart +++ b/test/unit_tests/workout_provider_test.dart @@ -4,6 +4,7 @@ import 'package:smoke_cess_app/providers/audio_provider.dart'; import 'package:smoke_cess_app/providers/timer_provider.dart'; import 'package:smoke_cess_app/providers/workout_provider.dart'; import 'package:smoke_cess_app/globals.dart' as globals; +import '../mock/audio_provider_mock.dart'; import '../mock/db_mock.dart'; void main() { @@ -16,7 +17,7 @@ void main() { setUp(() { timerProvider = TimerProvider(); - audioProvider = AudioProvider(); + audioProvider = AudioProviderMock(); workoutProvider = WorkoutProvider(timerProvider, audioProvider); });