Exemplo n.º 1
0
        public void When_SpeedRecorded_Changes_Current_Speed_Positively_SpeedProgress_Reflects_This_Correctly()
        {
            var recorder             = new Mock <IRecorder>();
            var manualProgress       = new Mock <IManualProgress>();
            var practiceTimeProgress = new Mock <IPracticeTimeProgress>();

            var speedProgress = new SpeedProgress(50, 100, 150, 100);

            using (var exerciseRecorder = new ExerciseRecorder(recorder.Object, 1, "Exercise Title", speedProgress, practiceTimeProgress.Object, manualProgress.Object))
            {
                exerciseRecorder.IncrementSpeed(25);

                Assert.AreEqual(125, exerciseRecorder.CurrentSpeed);
                Assert.That(exerciseRecorder.CurrentSpeedProgress, Is.EqualTo(75));
            }
        }
Exemplo n.º 2
0
        public void Adding_Speed_Changes_Current_OverallProgress_When_Applicably_Weighted()
        {
            var recorder             = new Recorder();
            var manualProgress       = new ManualProgress(0, 50);
            var speedProgress        = new SpeedProgress(0, 0, 120, 50);
            var practiceTimeProgress = new PracticeTimeProgress(0, 600, 50);

            using (var exerciseRecorder = new ExerciseRecorder(recorder, 1, "Exercise Title", speedProgress, practiceTimeProgress, manualProgress))
            {
                var progressBefore = exerciseRecorder.CurrentOverAllProgress;
                exerciseRecorder.IncrementSpeed(120);
                var progressAfter = exerciseRecorder.CurrentOverAllProgress;

                Assert.That(progressBefore, Is.LessThan(progressAfter));
                Assert.That(progressAfter, Is.EqualTo(33));
            }
        }