Ejemplo n.º 1
0
        public void Smell_detector_sanity_check(string[] sourceCode, int expectedIssues)
        {
            var detectionService = new SmellDetectorService();
            var report           = detectionService.AnalyzeCodeQuality(sourceCode);

            report.IssuesForCodeSnippet.Count().ShouldBe(expectedIssues);
        }
Ejemplo n.º 2
0
        public CodeEvaluation EvaluateCode(CodeSubmission submission)
        {
            var issueReport = _smellDetectorService.AnalyzeCodeQuality(submission.SourceCode);

            if (issueReport.IssuesForCodeSnippet.Count == 0)
            {
                return(new CodeEvaluation());
            }

            var qualityEvaluation = GatherLOSummaries(issueReport);
            var instructorLOs     =
                _instructor.GatherLearningObjectsForLearner(submission.LearnerId, qualityEvaluation.GetLearningObjectSummaries());

            qualityEvaluation.AddLearningObjects(instructorLOs);

            return(qualityEvaluation);
        }