public void Grading_Test()
        {
            s1.AddCode(@"..\..\..\Assets\Test Required FIles\SingleSubmissionTest\Source.c");
            s1.AddExe(@"..\..\..\Assets\Test Required FIles\SingleSubmissionTest\Source.exe");

            s1.CompileSubmittedCode();
            s1.RunSubmittedProgram();
            s1.CompareResultsToDesiredResults();
            s1.CalculateFinalGrade(0, 0, 0);
            decimal currentGrade = (decimal)s1.finalGrade;

            decimal desiredGrade = 0;

            Assert.AreEqual(currentGrade, desiredGrade);



            s1.CompileSubmittedCode();
            s1.RunSubmittedProgram();
            s1.CompareResultsToDesiredResults();
            decimal newdesiredGrade = 100;
            decimal newcurrentGrade = (decimal)s1.finalGrade;

            newcurrentGrade = s1.Grading(33, 33, 34);
            Assert.AreEqual(newcurrentGrade, newdesiredGrade);
        }
Пример #2
0
        public void ActivateGradingFinished()
        {
            int oldCodeWeight           = Submissions.codeWeight;
            int oldExeWeight            = Submissions.exeWeight;
            int oldcorrentResultsWeight = Submissions.correctResultsWeight;

            Submissions.codeWeight           = 100;
            Submissions.exeWeight            = 0;
            Submissions.correctResultsWeight = 0;

            Submissions.ActivateGrading();

            Assert.AreEqual(s1.finalGrade, s1.Grading(Submissions.codeWeight, Submissions.exeWeight, Submissions.correctResultsWeight));


            Submissions.codeWeight           = oldCodeWeight;
            Submissions.exeWeight            = oldExeWeight;
            Submissions.correctResultsWeight = oldcorrentResultsWeight;
        }