public void WeightedProgressCalculator_CalculateTotalProgress_Test_1()
        {
            var calculator = new WeightedProgressCalculator();

            calculator.Add(new WeightedObj(100, 6000));
            calculator.Add(new WeightedObj(60, 12000));
            calculator.Add(new WeightedObj(25, 6000));

            var progress = calculator.CalculateTotalProgress();

            Assert.That(progress, Is.EqualTo(61.25));
        }
        public void WeightedProgressCalculator_CalculateTotalProgress_Test_2()
        {
            var calculator = new WeightedProgressCalculator();

            calculator.Add(new WeightedObj(100, 25));
            calculator.Add(new WeightedObj(60, 40));
            calculator.Add(new WeightedObj(40, 60));
            calculator.Add(new WeightedObj(25, 75));

            var progress = calculator.CalculateTotalProgress();

            Assert.That(progress, Is.EqualTo(45.875));
        }
Beispiel #3
0
        public double GetPercentComplete()
        {
            if (ExerciseActivity == null || !ExerciseActivity.Any())
            {
                return(0);
            }

            var calculator = new WeightedProgressCalculator();

            calculator.Add(new WeightedMetric(GetManualProgressPercentComplete(), ManualProgressWeighting));
            calculator.Add(new WeightedMetric(CalculateSpeedPercentComplete(), SpeedProgressWeighting));
            calculator.Add(new WeightedMetric(CalculatePracticeTimePercentComplete(), PracticeTimeProgressWeighting));

            return(calculator.CalculateTotalProgress());
        }
Beispiel #4
0
            public void WeightedProgressCalculator_CalculateTotalProgress_Test_3()
            {
                var calculator = new WeightedProgressCalculator();

                calculator.Add(new WeightedObj(100, 25));
                calculator.Add(new WeightedObj(100, 40));
                calculator.Add(new WeightedObj(100, 60));
                calculator.Add(new WeightedObj(100, 40));
                calculator.Add(new WeightedObj(100, 60));
                calculator.Add(new WeightedObj(100, 40));
                calculator.Add(new WeightedObj(100, 60));
                calculator.Add(new WeightedObj(100, 40));
                calculator.Add(new WeightedObj(100, 60));
                calculator.Add(new WeightedObj(100, 75));


                var progress = calculator.CalculateTotalProgress();

                Assert.Equal(100, progress);
            }