コード例 #1
0
        public void TestMethod1()
        {
            ProcessSettings settings = new ProcessSettings();

            BaseProcess process = new MoCSValidationProcess(settings);

            ExecuteProcessResult result = process.Process();
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var logger  = Substitute.For <ILogger>();
            var facade  = Substitute.For <IBuildServiceFacade>();
            var filesys = new FileSystemWrapper();

            ProcessSettings processSettings = new ProcessSettings();

            processSettings.BaseResultPath    = @"c:\mocs\";
            processSettings.NunitAssemblyPath = @"C:\Program Files\NUnit 2.5.9\bin\net-2.0\framework";
            processSettings.CscPath           = @"C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe";
            processSettings.NunitConsolePath  = @"C:\Program Files\NUnit 2.5.9\bin\net-2.0\nunit-console.exe";

            processSettings.SourcesPath     = "";
            processSettings.OutputPath      = "";
            processSettings.TestLogFileName = "testresult.xml";
            processSettings.NunitTimeOut    = 5000;
            processSettings.CleanUp         = true;

            processSettings.Assignment = CreateTestAssignment(facade);

            processSettings.Submit = CreateTestSubmit();
            processSettings.Submit.TournamentAssignment.Assignment = processSettings.Assignment;

            ServiceLocator services = ServiceLocator.Instance;

            services.AddService(typeof(IFileSystem), filesys);

            BaseProcess          process = new MoCSValidationProcess(processSettings, filesys);
            ExecuteProcessResult result  = process.Process();

            richTextBox1.Clear();
            if (result.Result == ExitCode.Success)
            {
                this.panel1.BackColor = Color.Green;
            }
            else
            {
                this.panel1.BackColor = Color.Red;
                richTextBox1.AppendText(result.Output);
            }
        }
コード例 #3
0
ファイル: ValidationProcess.cs プロジェクト: ruudkok/MoCS
        public void Process()
        {
            IBuildServiceFacade facade = ServiceLocator.Instance.GetService <IBuildServiceFacade>();

            ProcessSettings settings = ServiceLocator.Instance.GetService <ProcessSettings>().Clone();

            settings.Submit = this.Submit;

            settings.Assignment = facade.GetAssignmentById(this.Submit.TournamentAssignment.Assignment.Id, true);
            this.Submit.TournamentAssignment.Assignment = settings.Assignment;

            facade.UpdateSubmitStatusDetails(Submit.Id, SubmitStatus.Processing, "submit is being processed", DateTime.Now);

            IFileSystem           fileSystem = ServiceLocator.Instance.GetService <IFileSystem>();
            MoCSValidationProcess process    = new MoCSValidationProcess(settings, fileSystem);
            ExecuteProcessResult  result     = process.Process();

            this.Result = result;
            SaveStatusToDatabase();
        }