Exemple #1
0
        /// <summary>
        /// the main processing method.
        /// </summary>
        /// <param name="sysSettings"></param>
        /// <param name="assignmentSettings"></param>
        /// <param name="submitSettings"></param>
        /// <returns></returns>
        public SubmitResult Process(SystemSettings sysSettings, AssignmentSettings assignmentSettings, SubmitSettings submitSettings)
        {
            SubmitResult submitResult = new SubmitResult();

            BatchFileCreator batchfileCreator = new BatchFileCreator(sysSettings, submitSettings, _fileSystem);
            string           buildFilePath    = batchfileCreator.CreateBuildFile();
            string           testFilePath     = batchfileCreator.CreateTestFile();


            submitResult = CompileAssembly(buildFilePath, batchfileCreator.OutputLogPath);
            //in case of an error, directly return
            if (submitResult.Status == SubmitStatusCode.CompilationError)
            {
                return(submitResult);
            }

            //check businessrules
            submitResult = CheckBusinessRules(batchfileCreator.OutputDllPath, assignmentSettings);
            if (submitResult.Status == SubmitStatusCode.ValidationError)
            {
                return(submitResult);
            }

            submitResult = TestAssembly(batchfileCreator.BatchfileTestPath, batchfileCreator.TestLogPath);

            if (submitResult.Status == SubmitStatusCode.TestError)
            {
                return(submitResult);
            }

            submitResult.Status = SubmitStatusCode.Success;

            return(submitResult);
        }
Exemple #2
0
        /// <summary>
        /// the main processing method. 
        /// </summary>
        /// <param name="sysSettings"></param>
        /// <param name="assignmentSettings"></param>
        /// <param name="submitSettings"></param>
        /// <returns></returns>
        public SubmitResult Process(SystemSettings sysSettings, AssignmentSettings assignmentSettings, SubmitSettings submitSettings)
        {
            SubmitResult submitResult = new SubmitResult();

            BatchFileCreator batchfileCreator = new BatchFileCreator(sysSettings, submitSettings, _fileSystem);
            string buildFilePath = batchfileCreator.CreateBuildFile();
            string testFilePath = batchfileCreator.CreateTestFile();

            submitResult = CompileAssembly(buildFilePath, batchfileCreator.OutputLogPath);
            //in case of an error, directly return
            if (submitResult.Status == SubmitStatusCode.CompilationError)
            {
                return submitResult;
            }

            //check businessrules
            submitResult = CheckBusinessRules(batchfileCreator.OutputDllPath, assignmentSettings);
            if (submitResult.Status == SubmitStatusCode.ValidationError)
            {
                return submitResult;
            }

            submitResult = TestAssembly(batchfileCreator.BatchfileTestPath, batchfileCreator.TestLogPath);

            if (submitResult.Status == SubmitStatusCode.TestError)
            {
                return submitResult;
            }

            submitResult.Status = SubmitStatusCode.Success;

            return submitResult;
        }