mocked audio provider for workout provider test

main
Julian Gegner 2023-03-06 23:06:33 +01:00
parent 58ce7fdb0e
commit 7985e3bd1d
2 changed files with 24 additions and 1 deletions

View File

@ -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) {}
}

View File

@ -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/timer_provider.dart';
import 'package:smoke_cess_app/providers/workout_provider.dart'; import 'package:smoke_cess_app/providers/workout_provider.dart';
import 'package:smoke_cess_app/globals.dart' as globals; import 'package:smoke_cess_app/globals.dart' as globals;
import '../mock/audio_provider_mock.dart';
import '../mock/db_mock.dart'; import '../mock/db_mock.dart';
void main() { void main() {
@ -16,7 +17,7 @@ void main() {
setUp(() { setUp(() {
timerProvider = TimerProvider(); timerProvider = TimerProvider();
audioProvider = AudioProvider(); audioProvider = AudioProviderMock();
workoutProvider = WorkoutProvider(timerProvider, audioProvider); workoutProvider = WorkoutProvider(timerProvider, audioProvider);
}); });