Example #1
0
        public void CalcWhatIfGrade_InputsOf100_Return100()
        {
            var testClass = ServiceFactory.Create_MockInteractor();
            var evals     = EvaluationFactory.Create_ListOfDomainModels();

            evals = evals.Select(e => new EvaluationDomainModel {
                Id = e.Id, CourseId = e.CourseId, Weight = 1, PointsEarned = 100, TotalPointsPossible = 100
            });

            var result = testClass.CalcWhatIfGrade(evals);

            result.WhatIfGrade.ShouldBe(100);
        }
Example #2
0
        public void CalcWhatIfGrade_WeightedInputsOf100_Return100()
        {
            var testClass = ServiceFactory.Create_MockInteractor();
            var evals     = EvaluationFactory.Create_ListOfDomainModels().ToList();

            evals[0].TotalPointsPossible = 25;
            evals[0].PointsEarned        = 25;
            evals[0].Weight = .5;
            evals[1].TotalPointsPossible = 25;
            evals[1].PointsEarned        = 25;
            evals[1].Weight = .15;
            evals[2].TotalPointsPossible = 25;
            evals[2].PointsEarned        = 25;
            evals[2].Weight = .15;
            evals[3].TotalPointsPossible = 25;
            evals[3].PointsEarned        = 25;
            evals[3].Weight = .20;

            var result = testClass.CalcWhatIfGrade(evals);

            result.WhatIfGrade.ShouldBe(100);
        }