Beispiel #1
0
        private Assignment CreateTestAssignment(IBuildServiceFacade facade)
        {
            //setup the mock for facade
            Assignment assignment = new Assignment();

            facade.GetAssignmentById(Arg.Any <int>(), true).Returns(assignment);
            assignment.Path = @"c:\mocs\assignments\1\";
            assignment.AssignmentFiles.Add(new AssignmentFile()
            {
                Name = "InterfaceFile", FileName = "IHelloWorld.cs"
            });
            assignment.AssignmentFiles.Add(new AssignmentFile()
            {
                Name = "NunitTestFileServer", FileName = "HelloWorldTestsServer.cs"
            });
            assignment.AssignmentFiles.Add(new AssignmentFile()
            {
                Name = "NunitTestFileClient", FileName = "HelloWorldTests.cs"
            });
            assignment.AssignmentFiles.Add(new AssignmentFile()
            {
                Name = "ServerFileToCopy", FileName = "serverfile1.xml"
            });
            assignment.AssignmentFiles.Add(new AssignmentFile()
            {
                Name = "ServerFileToCopy", FileName = "serverfile2.dll"
            });
            assignment.Id = 1;
            assignment.ClassNameToImplement     = "HelloWorld";
            assignment.InterfaceNameToImplement = "IHelloWorld";

            return(assignment);
        }
Beispiel #2
0
        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();
        }
Beispiel #3
0
        private Assignment CreateTestAssignment(IBuildServiceFacade facade)
        {
            //setup the mock for facade
            Assignment assignment = new Assignment();
            facade.GetAssignmentById(Arg.Any<int>(), true).Returns(assignment);
            assignment.Path = @"c:\mocs\assignments\1\";
            assignment.AssignmentFiles.Add(new AssignmentFile() { Name = "InterfaceFile", FileName = "IHelloWorld.cs" });
            assignment.AssignmentFiles.Add(new AssignmentFile() { Name = "NunitTestFileServer", FileName = "HelloWorldTestsServer.cs" });
            assignment.AssignmentFiles.Add(new AssignmentFile() { Name = "NunitTestFileClient", FileName = "HelloWorldTests.cs" });
            assignment.AssignmentFiles.Add(new AssignmentFile() { Name = "ServerFileToCopy", FileName = "serverfile1.xml" });
            assignment.AssignmentFiles.Add(new AssignmentFile() { Name = "ServerFileToCopy", FileName = "serverfile2.dll" });
            assignment.Id = 1;
            assignment.ClassNameToImplement = "HelloWorld";
            assignment.InterfaceNameToImplement = "IHelloWorld";

            return assignment;
        }