public async Task Generate(PreAssignment assignment, DirectoryHandler handler)
 {
     try
     {
         await GenerateImplementation(assignment, handler);
     }
     catch (EngineAssignmentExceptionData exceptionReport)
     {
         assignment.PreAssignmentReport = exceptionReport.Report;
         await PreAssignmentRepository.Update(assignment);
     }
 }
        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);
        }
Example #3
0
        public async Task RunPreAssignmentImpl(int id)
        {
            var assignment = await PreAssignmentRepository.Get(id);

            await Engine.RunPreAssignment(assignment);
        }