コード例 #1
0
 public async Task Generate(PreAssignment assignment, DirectoryHandler handler)
 {
     try
     {
         await GenerateImplementation(assignment, handler);
     }
     catch (EngineAssignmentExceptionData exceptionReport)
     {
         assignment.PreAssignmentReport = exceptionReport.Report;
         await PreAssignmentRepository.Update(assignment);
     }
 }
コード例 #2
0
        public async Task GenerateImplementation(PreAssignment assignment, DirectoryHandler handler)
        {
            var solutionRoot = EngineFileUtilities.ExtractZip(handler.Directory, "Solution",
                                                              assignment.Solution.Files);
            var solution      = AbstractSyntaxTreeGenerator.CreateFromFile(handler, Path.Combine(solutionRoot, assignment.Filename));
            var solutionClass = GetClassAbstractSyntaxTreeNode(assignment, solution);

            ValidateMethodDeclarations(assignment, solutionClass);

            var unitTests = await UnitTestGenerator.GenerateResults(assignment, handler, solutionRoot);

            assignment.TestProject.UnitTests = unitTests;
            assignment.PreAssignmentReport   = new PreAssignmentSucessReport();
            await PreAssignmentRepository.Update(assignment);
        }