public void RecordingStatusChanged_Event_Fired_On_Reset() { var called = false; var recorder = new TestRecorder(110); var speedProgress = new Mock <ISpeedProgress>(); var practiceTimeProgress = new Mock <IPracticeTimeProgress>(); var manualProgress = new Mock <IManualProgress>(); using (var exerciseRecorder = new ExerciseRecorder(recorder, 1, "Exercise Title", speedProgress.Object, practiceTimeProgress.Object, manualProgress.Object)) { exerciseRecorder.Resume(); exerciseRecorder.Pause(); exerciseRecorder.RecordingStatusChanged += (sender, args) => called = true; exerciseRecorder.Reset(); Assert.IsTrue(called); } }
public void RecorderViewModel_Recording_Reflects_Model_Recording() { var exerciseService = new Mock <IExerciseService>(); var exerciseRecorder = new ExerciseRecorder(new Recorder(), 1, "Exercise Title", new SpeedProgress(85, 85, 120, 10), new PracticeTimeProgress(300, 600, 10), new ManualProgress(0, 100)); var viewModel = new ExerciseRecorderViewModel(exerciseService.Object, exerciseRecorder); exerciseRecorder.Resume(); var recording = exerciseRecorder.Recording && viewModel.Recording; exerciseRecorder.Pause(); var paused = !exerciseRecorder.Recording && !viewModel.Recording; exerciseRecorder.Resume(); exerciseRecorder.Reset(); var reset = !exerciseRecorder.Recording && !viewModel.Recording; Assert.IsTrue(recording); Assert.IsTrue(paused); Assert.IsTrue(reset); }