Esempio n. 1
0
        public void When_Subtracted_And_SecondsAreFraction_Removes_Fraction_InIncrement()
        {
            var recorder             = new TestRecorder(340.3);
            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.SubtractMinutes(3);
                Assert.AreEqual(180, exerciseRecorder.RecordedSeconds);
            }
        }
Esempio n. 2
0
        public void When_Is_5Min40sec_Subtract_3Min_Minute_Is_3_Minutes()
        {
            var recorder             = new TestRecorder(340);
            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.SubtractMinutes(3);
                Assert.AreEqual(180, exerciseRecorder.RecordedSeconds);
            }
        }
Esempio n. 3
0
        public void Attempt_Subtract_Minutes_When_Recording_Does_Nothing()
        {
            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.SubtractMinutes(2);
                exerciseRecorder.Pause();

                Assert.That(exerciseRecorder.RecordedSeconds, Is.InRange(110, 112));
            }
        }
Esempio n. 4
0
        public void TickActionCallBack_Called_After_Subtracting_Minutes()
        {
            bool fired = false;

            void action() => fired = true;

            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.TickActionCallBack = action;
                exerciseRecorder.SubtractMinutes(2);

                Assert.IsTrue(fired);
            }
        }